Description
Marc Véron
2017-04-20 18:26:12 UTC
This would be a very nice. Combined with printable RFID cards, it would make a very useful improvement. If only the page order matters, this should be doable with little effort. Created attachment 62498 [details] [review] Bug 18465 - Patron card creator: Print on duplex card printer Card printers with duplex functionality need as input a PDF file where odd pages contain the front side and even pages the back side of the cards. This patch adds such functionality. To prepare test: - In Patron card creator > Templates, prepare a 1 up template (1 column / 1 row) that fits to a single card. Give it a name like 'Duplex card template' (Attention, Card with and Card height seem to have wrong labels, that will go to a separate bug). - In Patron card creator > Layouts create a layout for the front side and one for the back side. Give them names to easily remember (Card front layout, Card back layout) - Go to Patron card creator > Batches and test both layouts together with the 1 up template. Save and keepp both test files as reference. To test: - Apply patch. Restart memcached and plack. - Go to Patron card creator > Batches - Click "Export" for a batch - In the following screen, note the new field "Select a layout for the back side" with a hint what it is used for - Leave it on 'Back side layout not used', export and compare output with test ooutput from preparation. It should be the same - Select the layout you prepared for the back side. - Export - this file should contain 2 PDF pages per patron, one first with the front side, second with the back side. Hi Marc, we have some probems gettig the setup right, could you share screenshots/information about your configuration (template/layout) maybe? Created attachment 63011 [details]
Screenshots with test settings for duplex card printing...
Created attachment 63012 [details]
Results duplex card printing based on test settings
Hi Marc, thx, that's very helpful! Is it ok that both layouts say Page side = Front? (In reply to Katrin Fischer from comment #8) > Hi Marc, thx, that's very helpful! Is it ok that both layouts say Page side > = Front? Yes. This is only used for templates with multiple columns. For duplex card print we use only 1 row and 1 column, so it is not needed here. -------- Explanation for page side used with multiple columns: Workflow is to print first the front side, then turn the pages and then pront the back sides. Lets say you have a template with 3 columns and a batch with 3 patrons. The layout for the front prints the names: Name 1 | Name 2 | Name 3 And another layout for the back side prints the first names. Output should be: First name 3 | First name 2 | First name 1 ...to print 'First name 1' on the back of 'Name 1' Page side: 'Back' shuffles data to do that. (In reply to Marc Véron from comment #4) > Created attachment 62498 [details] [review] [review] > Bug 18465 - Patron card creator: Print on duplex card printer > (Attention, Card with and Card height seem to have wrong labels, that will > go to a separate bug). Not wrong labels but confusing sequence. See Bug 18528 Mine were not quite as pretty as yours - but it works really well! Created attachment 63046 [details] [review] [SIGNED OFF] Bug 18465 - Patron card creator: Print on duplex card printer Card printers with duplex functionality need as input a PDF file where odd pages contain the front side and even pages the back side of the cards. This patch adds such functionality. To prepare test: - In Patron card creator > Templates, prepare a 1 up template (1 column / 1 row) that fits to a single card. Give it a name like 'Duplex card template' (Attention, Card with and Card height seem to have wrong labels, that will go to a separate bug). - In Patron card creator > Layouts create a layout for the front side and one for the back side. Give them names to easily remember (Card front layout, Card back layout) - Go to Patron card creator > Batches and test both layouts together with the 1 up template. Save and keepp both test files as reference. To test: - Apply patch. Restart memcached and plack. - Go to Patron card creator > Batches - Click "Export" for a batch - In the following screen, note the new field "Select a layout for the back side" with a hint what it is used for - Leave it on 'Back side layout not used', export and compare output with test ooutput from preparation. It should be the same - Select the layout you prepared for the back side. - Export - this file should contain 2 PDF pages per patron, one first with the front side, second with the back side. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Still applies on current master Still applies on current master. create-pdf.pl 135 #my $print_layout_xml = $layout_back_xml; 136 my $print_layout_xml = (( ($cardscount % 2 == 1) && ( $layout_back_id ) ) ? 137 clone($layout_back_xml) : clone($layout_xml) ); Fist line looks like debug, is Clone being added as a dependency here? can we just make a copy? Otherwise worked well in testing (In reply to Nick Clemens from comment #15) > create-pdf.pl > > 135 #my $print_layout_xml = $layout_back_xml; > > 136 my $print_layout_xml = (( ($cardscount % 2 == 1) && ( $layout_back_id > ) ) ? > > 137 clone($layout_back_xml) : clone($layout_xml) ); > > Fist line looks like debug, is Clone being added as a dependency here? can > we just make a copy? > > Otherwise worked well in testing - Yes, #135 is a reminder of my tests and superfluous. As far as I remember it was not possible to have a simple copy like in line 135, that's why I used clone for a deep copy. - Clone is used at other places as well (git grep 'use Clone'). Should it be added to the dependencies? I would propose to do that in a separate bug. Ok, I tested without clone, it seems to work. Followup follows. Created attachment 64599 [details] Bug 18465: (followup) Do not use clone Use simple copy instead of clone, see comments #15 - #17 Created attachment 64600 [details] [review] Bug 18465: (followup) Fix issue with patron lists an ddo notuse clone This followup fixes duplex printing with patron lists. Additionaly, it uses simple copy instead of clone and removes a superfluous line, see comments #15 - #17 Created attachment 64601 [details] [review] Bug 18465: (followup) Fix issue with patron lists an do not use clone This followup fixes duplex printing with patron lists. Additionaly, it uses simple copy instead of clone and removes a superfluous line, see comments #15 - #17 Created attachment 64606 [details] [review] Bug 18465 - Patron card creator: Print on duplex card printer Card printers with duplex functionality need as input a PDF file where odd pages contain the front side and even pages the back side of the cards. This patch adds such functionality. To prepare test: - In Patron card creator > Templates, prepare a 1 up template (1 column / 1 row) that fits to a single card. Give it a name like 'Duplex card template' (Attention, Card with and Card height seem to have wrong labels, that will go to a separate bug). - In Patron card creator > Layouts create a layout for the front side and one for the back side. Give them names to easily remember (Card front layout, Card back layout) - Go to Patron card creator > Batches and test both layouts together with the 1 up template. Save and keepp both test files as reference. To test: - Apply patch. Restart memcached and plack. - Go to Patron card creator > Batches - Click "Export" for a batch - In the following screen, note the new field "Select a layout for the back side" with a hint what it is used for - Leave it on 'Back side layout not used', export and compare output with test ooutput from preparation. It should be the same - Select the layout you prepared for the back side. - Export - this file should contain 2 PDF pages per patron, one first with the front side, second with the back side. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 64607 [details] [review] Bug 18465: (followup) Fix issue with patron lists an do not use clone This followup fixes duplex printing with patron lists. Additionaly, it uses simple copy instead of clone and removes a superfluous line, see comments #15 - #17 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Pushed to master for 17.11, thanks to everybody involved! Enhancement not pushed to 17.05.x |