Reading in questionnaires printed 2-on-1

Asked by nst

Dear Adam,
I am looking for a way to read in quexml questionnaires printed two pages on one (to save paper). I understood that there is already some functionality built in in quexf to handle this situation, but if I pass the original scanned file (2-on-1) directly to quexf it only detects the page on the right hand side.

To circumvent this problem I tried to convert the pdf with the 2-on-1 into a 1-on-1 document by splitting and rescaling the pages, but either quexf doesn't handle the manipulated pdf at all (nothing happens after a processing time of over two hours- might the file size be an issue here) or the banding when checking the form doesn't match at all- although I manipulated the resolution of the cutted pdf to match that of the original pdf.

Could you please provide me a hint how to either use the built-in functionality or give me some information on what are the essential requirements for the pdf in order to make the second solution?
Thanks in advance and best regards,
Nils

Question information

Language:
English Edit question
Status:
Solved
For:
queXF Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Zammit
Solved:
Last query:
Last reply:
Revision history for this message
Adam Zammit (adamzammit) said :
#1

Hi Nils,

The split scanning function is enabled by default but the default settings assume you are scanning A3 pages and want 2 A4 pages from that.

If, for example you have scanned an A4 page and want two A5 pages from it, you will need to set the following directive in config.inc.php:

define('PAGE_WIDTH',1740);

This is calculated by taking the width of an A5 page in inches (see here: http://www.papersizes.org/a-paper-sizes.htm) - which is 5.8 then multiplying it by 300 (as queXF works by default on a resolution of 300dpi) - which is 1740.

So if you have a different expected page width please adjust using that formula. Then if queXF detects a page of around double that width, it will split it in two.

Regards,
Adam Zammit

Revision history for this message
nst (nst16) said :
#2

Dear Adam,
thanks for your quick response. Your proposal was really helpful- the barcode detection worked beautifully with these settings. There is however still a little problem- the blank form created in quexml had a page format A4 so the banding created in this document did not match the scanned pages with format A5. Unfortunately there is no output option A5 in quexml so I tried to modify the index.php of the quexml package trying to add an A5 option- unfortunately without success- but perhaps you also have a simple solution for that.
Thanks again
Best,
Nils

Revision history for this message
Adam Zammit (adamzammit) said :
#3

Hi Nils,

When importing the template document / banding into queXF - I'd suggest you use the original PDF and banding XML file generated by queXML (i.e. in A4) and set it up assuming you would be scanning them in "regular" A4 size.

Thinking about this - it is possible there is a bug in the system where you may need to remove the line: define('PAGE_WIDTH',1740); from the config.inc.php file BEFORE importing the templat / banding XML, then put it back again BEFORE importing completed PDF forms.

Then when you import the A5 size forms (2 to a page) - the system should scale the pages automatically.

If this procedure works for you - please let me know and I will attempt to fix it.

Regards,
Adam Zammit

Revision history for this message
nst (nst16) said :
#4

Dear Adam,
thanks again for your suggestions and sorry for the delayed response. I tried the procedure you proposed in your last message- unfortunately the banding is still way off. I can prepare a set of files for demonstration- in case you are interested.
Currently my preferred solution is to convert the template to A5 300 dpi- via an appropriate modification in quexml- or by manipulating the original A4 output using gs. Let me know if you have any further suggestions- if everything else fails I will have to stick with scanning entire A4 pages.
Thanks again
Nils

Revision history for this message
Adam Zammit (adamzammit) said :
#5

Hi Nils,

Yes I'm happy to test this out. Please send the original PDF and banding XML generated by queXML and a scanned form - you can send it directly to me and I will use it only for testing.

Regards,
Adam Zammit

Revision history for this message
nst (nst16) said :
#6

Dear Adam,
I tried to send the requested documents via email but I am not sure if they reached you. Here is now another try:
At
https://www.dropbox.com/sh/1gjlk1k9p7g75b9/AACh5UhG7gaUec-0S-iJkQTHa?dl=0
you can find quexml xml file, A4 template, and 300dpi A4 scanned test file.
Best regards,
Nils

Revision history for this message
Adam Zammit (adamzammit) said :
#7

Thanks Nils,

I think I have discovered the issue. It is related to the way queXF handles the page setup function. I am working on an update and will notify you of my progress.

Regards,
Adam Zammit

Revision history for this message
Best Adam Zammit (adamzammit) said :
#8

Hi Nils,

Thank you for your patience. I believe this is solved in the latest release of queXF 1.18.0 (see here: https://launchpad.net/quexf/+download as sourceforge is offline)

Please give it a test and let me know - also the configuration file should have this setting:

define('PAGE_WIDTH',1754);

Not the width I advised earlier.

Regards,
Adam Zammit

Revision history for this message
nst (nst16) said :
#9

Dear Adam,
thanks for your efforts. I really appreciate the time you put into this problem. I tried to test the new release with the sample files I sent you a while ago. Using page width 1754 the barcode identification worked beautifully and the banding on the scanned form looked much better- but still not quite right. I guess you checked the release with exactly these files so I must be doing something wrong- for example I put in the page width right from the start so in particular before importing the template A4 file- is that how it was intended? Perhaps you have an idea what went wrong here.
Thanks again
Best,
Nils

Revision history for this message
Adam Zammit (adamzammit) said :
#10

Hi Nils,

My apologies for the delayed reply.

It appears the banding XML file is overriding the automatic page setup. Please go to the "Page setup" function then click on a page in the questionnaire - then click on "Page setup disabled (click to enable)" wait for the page reload, then click on "Page setup enabled (click to DISABLE)". Then try importing again. This will fix the page setup issue.

Adam

Revision history for this message
nst (nst16) said :
#11

Dear Adam,
the problem was entirely on my side. I forgot to update the database after your package update. Now everything works beautifully even without the page setup page. Thanks again for all your efforts.
Best,
Nils

Revision history for this message
nst (nst16) said :
#12

Thanks Adam Zammit, that solved my question.