Boomaga / boomaga

Boomaga provides a virtual printer for CUPS. This can be used for print preview or for print booklets.
Other
182 stars 34 forks source link

enhancement: change page ordering for 4on1 function #16

Closed ghost closed 10 years ago

ghost commented 10 years ago

I have 4 pages and want them on one sheet. Currently, the output for portrait format is: 12 34

and for landscape format (turn it 90° clockwise mentally and you'll get:) 31 42

However, I prefer the output for portrait 13 24 and for landscape 13 24

Is it possible to add a function which allows the configuration of the sequence of the pages on the sheet?

Because github doesn't support file attachments I've uploaded some example pdfs here: http://kabelfunk.de/boomaga/sequence.tar.gz __single_pages.pdf are the templates _4_on1_right_now.pdf shows the current output of boomaga _4on1wish.pdf demontrates another output, as I prefer. ("" stands for portrait or landscape)

SokoloffA commented 10 years ago

I understand you, and agree with you. I think will be better to add new layout for this. There is only one question how to name it and current layout. Any suggestions.

ghost commented 10 years ago

Combobox "Page Order: " with two options:

Horizontal is the current layout, vertical the new one. the acrobat reader does the same: auswahl_073

SokoloffA commented 10 years ago

So you suggest to use combobox. Look not bad: combo

My suggestion, is add 2 radio buttons. This requires some more vertical space than your disign, but IMHO this is more clear interface, no dependencies between controls. radiobutton

What do you think?

ghost commented 10 years ago

Your's much better. users can choose the layout order only where it does make sense. (only for 4 and 8, and not for 1 or 2)

SokoloffA commented 10 years ago

What do you think. Is titles like "4 up horizontal" clear, or we should to write more in detail?

ghost commented 10 years ago

I also can imagine "4 up, horizontal order", but I can't say which is better. Due to the preview, the users will see the effect immediately. A picture is worth a thousand words. :-)

SokoloffA commented 10 years ago

This feature was done in the (develop branch)[https://github.com/Boomaga/boomaga/tree/develop]. Please test it, is it what you wanted? If you have skills, you can clone devel branch and build the project from sources:

git clone https://github.com/Boomaga/boomaga.git --branch develop cd boomaga mkdir build cd build cmake make make install

If you haven't such skill, say me what distro you are use and I try to build program for you.

ghost commented 10 years ago

I've installed some devel packages and then tried these steps

git clone https://github.com/Boomaga/boomaga.git --branch develop cd boomaga mkdir build cd build cmake .. make make install

but it stops at the make command. [I have replaced all spaces with underline, because gitgub eliminates all double and more spaces.] ... [_68%]_Building_CXX_object_gui/CMakeFiles/boomaga.dir/export/exporttopdf.cpp.o [_70%]_Building_CXX_object_gui/CMakeFiles/boomaga.dir/export/exporttopdfprinter.cpp.o [_71%]_Building_CXX_object_gui/CMakeFiles/boomaga.dir/kernel/boomagapoppler.cpp.o /home/dom/src_64/boomaga/gui/kernel/boomagapoppler.cpp:76:17:_error:_conflicting_return_type_specifiedfor‘virtual_int_PJLFileStream::getPos()’ _virtual_intgetPos() ____^ In_file_includedfrom/usr/include/poppler/Object.h:333:0, from/usr/include/poppler/XRef.h:41, ____from/usr/include/poppler/PDFDoc.h:45, ____from/home/dom/src64/boomaga/gui/kernel/boomagapoppler.h:31, from_/home/dom/src_64/boomaga/gui/kernel/boomagapoppler.cpp:27: /usr/include/poppler/Stream.h:461:19:_error:overriding‘virtual_Goffset_FileStream::getPos()’ **_virtual_GoffsetgetPos(){_returnbufPos+(bufPtr-buf);} ___*^ /home/dom/src_64/boomaga/gui/kernel/boomagapoppler.cpp:_Inconstructor‘PJLFileStream::PJLFileStream(FILE_,_Guint,_GBool,_Guint,Object)’: /home/dom/src_64/boomaga/gui/kernel/boomagapoppler.cpp:67:17:_error:_no_matching_function_for_callto‘FileStream::FileStream(FILE_&,_Guint&,_GBool&,_Guint&,Object&)’ mFile(fA) ____^ /home/dom/src_64/boomaga/gui/kernel/boomagapoppler.cpp:67:17:_note:_candidates_are: In_file_includedfrom/usr/include/poppler/Object.h:333:0, from/usr/include/poppler/XRef.h:41, ____from/usr/include/poppler/PDFDoc.h:45, ____from/home/dom/src64/boomaga/gui/kernel/boomagapoppler.h:31, from_/home/dom/src_64/boomaga/gui/kernel/boomagapoppler.cpp:27: /usr/include/poppler/Stream.h:448:3:_note:FileStream::FileStream(GooFile,_Goffset,_GBool,_Goffset,Object) ___FileStream(GooFile_fileA,_Goffset_startA,_GBool_limitedA, _^ /usr/include/poppler/Stream.h:448:3:_note:___no_known_conversion_for_argument_1from‘FILE{akaIOFILE}’to‘GooFile_’ /usr/include/poppler/Stream.h:445:7:_note:_FileStream::FileStream(const_FileStream&) _class_FileStream:_publicBaseStream{ _____^ /usr/include/poppler/Stream.h:445:7:_note:_candidate_expects_1_argument,_5_provided make[2]:_[gui/CMakeFiles/boomaga.dir/kernel/boomagapoppler.cpp.o]_Fehler1 make[1]:[gui/CMakeFiles/boomaga.dir/all]_Fehler_2 make:**_[all]_Fehler_2


I'm using openSUSE 13.1 (64-bit)

(if it's interesting, I got boomaga from repo http://download.opensuse.org/repositories/home:/Lazy_Kent/openSUSE_13.1/x86_64/ but I saw right now that the more officially repo http://download.opensuse.org/repositories/Printing/openSUSE_13.1/x86_64/ is providing you program, too.

ghost commented 10 years ago

Forget my previous comment. I tooked the released branch and cherry-picked the commit 99d0ec73a9cb344d0d5d827f3f29989ab2e5de74

Then the make command was successful. I did some tests and for prints in portrait format is looks great.

But not for landscape. example for "4 up horizontal": auswahl_074

and now rotate it 90° clockwise: auswahl_074rot

Same issue for "4 up vertical" auswahl_075 and now rotate it 90° clockwise: auswahl_075rot

It internal page ordering for landscape must be different to portrait. for portrait (horizonal) the order sequence is: left to right, top to bottom. for landscape (horizontal) the order sequence is: bottom to up, left to right for portrait (vertical) the order sequence is: top to bottom, left to right for landscape (vertical) the order sequence is: left to right, bottom to top

SokoloffA commented 10 years ago

About building. I hate poppler for unstable API! I'll let you know when will triumph over it.

SokoloffA commented 10 years ago

I add comatability with poppler > 0.23. Please check.

SokoloffA commented 10 years ago

I agree, boomaga processes landscape pages incorrect, and this is a bug. But when I print lanscape document from the LibreOffice and get different picture.

4 up horizontal layout.

As you see, I have a horizontal text, and pages are landscape oriented.

In your examples, text is rotated and pages have portrait orientation. It's look like you have portrait document with rotated text. Is it's true? How you created document?

In my situation I can determine what the page is landscape. But in your not.

ghost commented 10 years ago

Yes, I can reproduce the behavior in libreoffice as you explained. When I print directly from libreoffice I get your results. However, that weird, because it shrinks the landscape page until it fits on a portrait. That's a total waste of space. Your example reveals it excellently. Even more, a can reproduce it in kwrite, too. I don't know where this bug is located... [PS: printing from libreoffice or kwrite as landscape directly on a real printer works as expected!]

OK, back to my example. What I did: libreoffice writer->file->export as PDF opened it in okular, print to boomaga.

I have updated the attachment (http://kabelfunk.de/boomaga/sequence.tar.gz) with the libreoffice document I used for the examples and added also two further pdf files. (both landscape pdfs)

ghost commented 10 years ago

about building: with your latest commit the compiler issues with poppler are solved.

SokoloffA commented 10 years ago

However, that weird, because it shrinks the landscape page until it fits on a portrait. That's a total waste of space. Your example reveals it excellently.

I know, in my previous post I wrote - is a bug, and it should be fixed. And the most important, I can detect this situation, width/height of page don't match with width/height of the sheet.

PS: printing from libreoffice or kwrite as landscape directly on a real printer works as expected!]

Obviously, the printer prints portrait pages, with rotated text. In fact, the printer uses "1up layout", the boomaga works correctly with such documents in "1up layout" too. Interesting, boomaga has some bug, if you use layout with rotation (2up, 8up, booklet) and export it to PDF, this file is portrate with rotated text. I plan to fix it soon.

OK, back to my example. What I did: libreoffice writer->file->export as PDF opened it in okular, print to boomaga.

I can reproduce this. And I need some time for analyzing these files, I'll let you know when I'll get some results.

SokoloffA commented 10 years ago

@Dominik3 I finished. Please test how it works.

ghost commented 10 years ago

Tests for Portraits: OK Test for landscape: partly OK.

  1. What's not working: If you take the example pdf from comment 1 (filename landscape_single_pages.pdf) the output is still: auswahl_085 page 1 & 2 should be on the bottom and page 3 & 4 on top.
  2. What is working: Open kwrite, enter some lines, print as landscape to boomaga: Output is as it should. auswahl_087
  3. What is not working: Open kwrite, enter some lines, print as landscape to pdf, open pdf with okular, print to boomaga: same problem as with 1. auswahl_088
ghost commented 10 years ago

Third.: What is not working: Open kwrite, enter some lines, print as landscape to pdf, open pdf with okular, print to boomaga: same problem as with 1. auswahl_088

SokoloffA commented 10 years ago

I change backend, I hope we won it. Now pdf from comment 1 (filename landscape_single_pages.pdf) work fine.  landscape_single_pages.pdf I havn't kwrite, so I use kate. Kate->okular->boomaga wrok fine for me too.  landscape_single_pages.pdf

Please test how it works. Note! You should delete and reinstal printer.

ghost commented 10 years ago

Awesome! Tests completed. Everything fine! (landscape/portrait prints from pdf as well as from kwrite) Thank you very much.

Ready for 0.6 Release :-)

SokoloffA commented 10 years ago

I'm glad.