Boomaga / boomaga

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

do not duplex on short edge for 2-on-1 or 8-on-1. #56

Closed Dominik3 closed 6 years ago

Dominik3 commented 7 years ago

When I choose duplex, boomaga use normally the long-edge. Good. However, if I activate 2-on-1 or 8-on1 then boomaga uses the short-edge. (in other words, the backside is rotated by 180°) Boomaga should stick to long-egde for all layouts (1-on-1, 2-on-1, 4-on 1, 8-on-1).

alium commented 6 years ago

yes, please, i have same problem! After making brochure i muss use another program for rotating every second page of document....

SokoloffA commented 6 years ago

@Dominik3 and @alium I created a branch issue_56. I changed the code, please check is this what you want? f you have skills, you can build the project from sources. This page may be useful to you. f you haven't such skill, say me what distro you are use and I try to build program for you.

But it is not a fix of the problem, now the program will be incorrect work for me. The program should determine the type of duplex. For this I need more information. Please give me the following information.

  1. Boomaga config file

    cat cat ~/.config/boomaga/boomaga.conf
  2. List of your printers names

    lpstat -a
  3. Options of your hardware printer

    lpoptions -p YOUR_HARDWARE_PRINTER_NAME -l
  4. PPD file for your hardware printer

    sudo cat /etc/cups/ppd/YOUR_HARDWARE_PRINTER_NAME.ppd
alium commented 6 years ago

Hi SokoloffA! I can not test branch issue_56, because Boomaga works for me no more.... Why? As boomaga-qt5 maintainer for AUR, Arch use now poppler 0.59, so i am added patch from pull request #59 to build, because without i can not compiling the Boomaga (see build_error.log). But now, if i open the pdf document, show me windows only white page - see picture and terminal show me lot of errors as: "poppler/error (70167): Bad 'Length' attribute in streampoppler/error (70717): Missing 'endstream' or incorrect stream lengthpoppler/error (70167): Bad 'Filter' attribute in streampoppler/error (70167): Bad 'Length' attribute in streampoppler/error (70717): Missing 'endstream' or incorrect stream lengthpoppler/error (70167): Bad 'Filter' attribute in streampoppler/error (70167): Bad 'Length' attribute in streampoppler/error." boomaga_log So actually i can not test nothing, because i see no input/output.

Evidently problem with poppler... I see the problem with poppler is more complex, lot of distribution use various version of poppler, which is under active development... Boomaga build without #59 patch: build_error.log

Dominik3 commented 6 years ago

dom@linux-gdh6:~/boomaga> cat ~/.config/boomaga/boomaga.conf

[ExportPDF]
FileName=~/Untitled.pdf

[MainWindow]
Geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\0P\0\0\0>\0\0\x4\xfb\0\0\x3\x9c\0\0\0T\0\0\0[\0\0\x4\xf7\0\0\x3\x98\0\0\0\0\0\0\0\0\a\x80)
PageListIconSize=64
PageListTab=0
SplitterPos=276
State=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x4\xa4\0\0\x2\xcb\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)

[Preferences]
Geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x1\xc6\0\0\x1<\0\0\x3}\0\0\x2\x64\0\0\x1\xca\0\0\x1Y\0\0\x3y\0\0\x2`\0\0\0\0\0\0\0\0\a\x80)

[PrinterSettingsDialog]
Geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x1|\0\0\0\xd9\0\0\x3\xc8\0\0\x2\xc7\0\0\x1\x80\0\0\0\xf6\0\0\x3\xc4\0\0\x2\xc3\0\0\0\0\0\0\0\0\a\x80)

[Printer_HLL8250CDN]
CurrentProfile=0
Profiles\1\Border=false
Profiles\1\BottomMargin=0
Profiles\1\ColorMode=Auto
Profiles\1\DuplexType=Auto
Profiles\1\InternalMargin=0
Profiles\1\LeftMargin=0
Profiles\1\Name=Default
Profiles\1\ReverseOrder=false
Profiles\1\RightMargin=0
Profiles\1\TopMargin=0
Profiles\size=1

[Project]
AllowNegativeMargins=false
AutoSave=false
AutoSaveDir=~/Documents/Boomaga files
DoubleSided=true
Layout=1up
Printer=HLL8250CDN
SaveDir=/home/dom
SubBookletSize=20
SubBookletsEnable=true
Dominik3 commented 6 years ago
dom@linux-gdh6:~/boomaga> lpstat -a
Boomaga accepting requests since Thu 05 Oct 2017 05:04:41 PM CEST
HLL8250CDN accepting requests since Thu 05 Oct 2017 05:00:31 PM CEST
Dominik3 commented 6 years ago
dom@linux-gdh6:~/boomaga> lpstat -a
Boomaga accepting requests since Thu 05 Oct 2017 05:04:41 PM CEST
HLL8250CDN accepting requests since Thu 05 Oct 2017 05:00:31 PM CEST
Dominik3 commented 6 years ago
dom@linux-gdh6:~/boomaga> lpoptions -p HLL8250CDN -l
PageSize/Media Size: *A4 Letter Legal Executive A5 A6 ISOB5 B5 JISB6 EnvDL EnvC5 Env10 EnvMonarch Br3x5 FanFoldGermanLegal Postcard EnvYou4 EnvChou3 210x270mm 195x270mm 184x260mm 197x273mm
Duplex/Two-Sided: DuplexTumble *DuplexNoTumble None
BRInputSlot/Paper Source: *AutoSelect Tray1 Tray2 MPTray
BRResolution/Print Quality: *600dpi 600x2400dpi
BRMonoColor/Color / Mono: *Auto FullColor Mono
BRMediaType/Media Type: *Plain Thin Thick Thicker BOND Env EnvThick EnvThin Recycled Label Glossy PostCard
BRColorMatching/Color Mode: *Normal Vivid None
BRGray/Improve Gray Color: OFF *ON
BREnhanceBlkPrt/Enhance Black Printing: *OFF ON
BRTonerSaveMode/Toner Save Mode: *OFF ON
BRImproveOutput/Improve Print Output: *OFF BRLessPaperCurl BRFixIntensity
BRSkipBlank/Skip Blank Page: *OFF ON
BRBrightness/Brightness: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRContrast/Contrast: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRRed/Red: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRGreen/Green: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRBlue/Blue: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRSaturation/Saturation: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Dominik3 commented 6 years ago

HLL8250CDN.ppd.txt

Dominik3 commented 6 years ago

I've installed the boomaga branch issue_56, but that isn't changing the behavior. (I've used a Virtual maschine with openSUSE Tumbleweed to be sure, that I'm not using an old version from any repository.

SokoloffA commented 6 years ago

@Dominik3 and @alium First of all, what is the right edge? We may want to print a wall calendar (rotating along long edge) wall calendar

Or we want to print desk calendar (rotating along short edge) desktop calendar

Which variant do you expect?


In any case, I realized that the program has glitches. Please make some experiments.

Download the test PDF file and print it from the console using the following commands:

lpr -P YOUR_PRINTER_NAME -o Duplex=DuplexNoTumble      08-pags-two_page_per_sheet.pdf 
lpr -P YOUR_PRINTER_NAME -o Duplex=DuplexTumble        08-pags-two_page_per_sheet.pdf 
lpr -P YOUR_PRINTER_NAME -o sides=two-sided-short-edge 08-pags-two_page_per_sheet.pdf 
lpr -P YOUR_PRINTER_NAME -o sides=two-sided-long-edge  08-pags-two_page_per_sheet.pdf 

Let me know which calendar you received in each case.

Dominik3 commented 6 years ago

a) desktop calendar b) wall calendar c) wall calendar d) desktop calendar

I personally prefer desktop calendar. But there are surely people out there who're preferring the wall calendar. Some tools like the acrobat reader (Windows) offers an option to choose the duplex mode: duplex on short edge (=two-sided-short-edge) or an long edge (=two-sided-long-edge).

SokoloffA commented 6 years ago

OK, I understood the problem. I have a printer with duplex only on my work. So I will write a prototype in a week.

SokoloffA commented 6 years ago

@Dominik3 I added options "Flip on long edge" and "Flip on short edge" options to a branch issue_56. Please test it if you find time.

@alium I'm working on dropping the poppler private.

Dominik3 commented 6 years ago

I run into some build failures:

dom@linux-gdh6:~> cd boomaga/
dom@linux-gdh6:~/boomaga> git pull
remote: Counting objects: 50, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 50 (delta 38), reused 50 (delta 38), pack-reused 0
...

dom@linux-gdh6:~/boomaga> git branch
* issue_56
  master

dom@linux-gdh6:~/boomaga> cd build/

dom@linux-gdh6:~/boomaga/build> cmake ..
CMake Warning (dev) at /usr/lib64/cmake/Qt5/Qt5ModuleLocation.cmake:4 (set):
  Policy CMP0053 is not set: Simplify variable reference and escape sequence
...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dom/boomaga/build

dom@linux-gdh6:~/boomaga/build> make && sudo make install
[ 10%] Built target boomagabackend
...
[ 41%] Building CXX object gui/CMakeFiles/boomaga.dir/icon.cpp.o
[ 42%] Building CXX object gui/CMakeFiles/boomaga.dir/printersettings/printersettings.cpp.o                                                                                     
/home/dom/boomaga/gui/printersettings/printersettings.cpp: In constructor ‘PrinterSettings::PrinterSettings(QWidget*)’:
/home/dom/boomaga/gui/printersettings/printersettings.cpp:104:60: error: ‘virtual void QListWidget::setModel(QAbstractItemModel*)’ is private within this context
     ui->profilesList->setModel(new QStandardItemModel(this));
                                                            ^
In file included from /usr/include/qt5/QtWidgets/QListWidget:1:0,
                 from /home/dom/boomaga/build/gui/ui_printersettings.h:26,
                 from /home/dom/boomaga/gui/printersettings/printersettings.cpp:27:
/usr/include/qt5/QtWidgets/qlistwidget.h:294:10: note: declared private here
     void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
          ^~~~~~~~
/home/dom/boomaga/gui/printersettings/printersettings.cpp:128:9: error: ‘class Ui::PrinterSettings’ has no member named ‘landscapeFlipComboBox’
     ui->landscapeFlipComboBox->addItem(tr("Flip on long edge"),  int(FlipType::LongEdge));
...
SokoloffA commented 6 years ago

Sometimes a cmake + Qt does not work correctly after changing the files of forms. Did you do a clean build? Delete all files in the "build" directory before building.

Dominik3 commented 6 years ago

Yes, deleting all files in build solved the issue. Short: it works.

My first test case was an 8 page document (libreoffice writer) with orientation "portrait". And I always prefer duplex on long side (of the printed page). Chosen layout in boomaga:

=> I have to choose "Flip on long edge" for both option (portrait and landscape) because otherwise the result would depend on the chosen layout (1uo, 2uo, 4up, ...)

The second test case was the same as number one, but the original document had orientation "landscape". Chosen layout in boomaga:

=> It's like test case one, but vice versa. Again, I will configure boomaga to "Flip on long edge" for portrait and landscape as well.


Final result and suggestion: If I choose "Flip on long edge" for both orientations, then the results will be exactly as wanted. It doesn't matter what the orientation of the original document is nor if I choose 1up, 2up, 4up, ... Good. THANK YOU. And if somebody wants the opposite - just use "Flip on short edge".

However, I don't see any use cases for having two options.

If both are not equal then the output depends very much on the layout option (1up, 2up, 4up) and the orientation of the original document. It is therefore difficult to predict the result unless you choose the same setting for both options. Reducing the both options to one would be my recommendation.

SokoloffA commented 6 years ago

OK. I left only one setting for a flipping.