Bug 129214 - Enter a custom size for print paper in Print-Page Layout
Summary: Enter a custom size for print paper in Print-Page Layout
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.3.3.2 release
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL: https://help.libreoffice.org/7.1/en-U...
Whiteboard:
Keywords:
Depends on:
Blocks: Print-Dialog
  Show dependency treegraph
 
Reported: 2019-12-05 21:19 UTC by Prichy
Modified: 2021-04-26 13:38 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Print Dialog (73.85 KB, image/png)
2019-12-11 08:35 UTC, Rania Amina
Details
The .ppd file for the printer as requested (8.59 KB, text/plain)
2021-01-05 21:57 UTC, Prichy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Prichy 2019-12-05 21:19:02 UTC
Description:
Printing pages of non-standard sizes is impossible due to the print dialogue. The print dialogue only allows a few standard sizes to be specified (A4, Letter etc) despite virtually any page size being specified when creating docs. The printer errors if the paper being used does not match that specified by LibreOffice. Remove the unnecessary page size in the print dialogue in order to print the native sizes in the document.

Steps to Reproduce:
1.Create a document of non-standard size
2.Ctrl-P to invoke print dialogue
3.Cannot enter a custom size or even some standard sizes (A6 for instance)
4.Print anyway

Actual Results:
The printer errors because the loaded paper that matches the document does not match what the print dialogue tells it

Expected Results:
Print the document according to the page size in the document


Reproducible: Always


User Profile Reset: No



Additional Info:
The print dialogue should not contain the paper size - that's embedded in the document - possibly different for each page. Please don't blame this on the print driver; I know the theory is that all sizes available should be exported by the print driver - but that's simply not necessary and other software (AbiWord) simply works (the print dialogue does not force a page size).
Comment 1 Ahmad Haris 2019-12-11 08:22:42 UTC
I can't reproduce this. I success print on A6 while printer using Letter.

Version: 6.3.3.2.0+
Build ID: 6.3.3.2-7.fc31
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 2 Rania Amina 2019-12-11 08:35:07 UTC
Created attachment 156469 [details]
Print Dialog

I've test the case on LibreOffice 6.3 and LibreOfficeDev 6.5, both of them can print the document correctly. Option for A6 paper found at print dialog, please tak a look at my attachment.
Comment 3 QA Administrators 2020-06-09 03:43:28 UTC Comment hidden (obsolete)
Comment 4 Timur 2020-06-09 11:03:55 UTC
It's obvious that "Cannot enter a custom size" for print paper is true.
Help doesn't say anything about that. 
I'll confirm as enhancement so far. 
Even if not done, documentation should be improved.
Comment 5 Timur 2020-06-09 11:09:01 UTC
Please test if custom size can be used via File > Printer Settings.
Comment 6 Michael Weghorn 2020-06-10 08:18:20 UTC
(In reply to Prichy from comment #0)
> Additional Info:
> The print dialogue should not contain the paper size - that's embedded in
> the document - possibly different for each page. Please don't blame this on
> the print driver; I know the theory is that all sizes available should be
> exported by the print driver - but that's simply not necessary and other
> software (AbiWord) simply works (the print dialogue does not force a page
> size).

Whether custom sizes are possible and how they are handled in my understanding depends quite a lot on the OS being used and the printer driver, so what system are you using?

I personally disagree that LibreOffice should ignore what the print driver offers. That's how the printing systems are designed to work, so IMHO print drivers (or the printers themselves in the case of driverless printing like e.g. IPP Everywhere) should expose the options that can be used...
(Dong things "not allowed" by the print drivers may lead to all kinds of other problems, like errors since the printer cannot handle what it was passed, paper jams,...)

I also do not think that the page size choice should be removed from the print dialog, since it is a valid use case to print a document on a different page size than the document's page size. (e.g. I do not have Letter paper, but might want to print documents in letter format on A4 instead...)
Comment 7 Prichy 2020-06-10 16:15:31 UTC
Hi all - not sure what specific info is required but here's more explanation. I think this issue has come to light because I now have a very picky printer (Xerox phaser 6510). The problem is that you have to tell it what paper you've loaded. When you go to print, if the paper size 'required' via the printyer dialogue doesn't match, what it has loaded, it refuses to print - very annoying. So the problem is that although I can format a single page to e.g. 144x144mm, LibreOffice then insists I select a 'standard' size in the print dialogue - a size for the whole document it seems. 144x144 isn't an option on my driver. So it could be argued this is a fault with the *printer driver* not allowing custom sizes - but even if that were possible, how would it do it on a page-by-page basis? And before you ask, if I tell the printer it's A4 and set the print diaglogue to A4, then I get a printer jam because it thinks the paper's torn. So I admit the unnecessarily picky firmware on my printer doesn't help - and I've never had this issue before I bought this model. But nonetheless, I think there is a fault with the logic in LibreOffice here. Perhaps if specific page sizes are set up in the doc', then the print dialogue should not insist on an overall page size for the entire doc, which I agree is otherwise a useful thing to be able to do! I'm using Ubuntu 19.10 with the default printer driver "(Xerox Phaser 6510, driverless, cups-filters 1.25.11"). As mentioned, I can print non-standard sizes using AbiWord via the same printer driver as the print dialogue doesn't appear to require a paper size.
Comment 8 Michael Weghorn 2020-06-24 12:02:11 UTC
(In reply to Prichy from comment #7)
> Hi all - not sure what specific info is required but here's more
> explanation. I think this issue has come to light because I now have a very
> picky printer (Xerox phaser 6510). The problem is that you have to tell it
> what paper you've loaded. When you go to print, if the paper size 'required'
> via the printyer dialogue doesn't match, what it has loaded, it refuses to
> print - very annoying. So the problem is that although I can format a single
> page to e.g. 144x144mm, LibreOffice then insists I select a 'standard' size
> in the print dialogue - a size for the whole document it seems. 144x144
> isn't an option on my driver. So it could be argued this is a fault with the
> *printer driver* not allowing custom sizes - but even if that were possible,
> how would it do it on a page-by-page basis?

Out of curiosity:
Have you tried printing a document with different page sizes in LibreOffice and AbiWord? I'd really be interested what happens in both cases. Do you insert different sheets of paper in the order that the pages are to printed in this case, or how does the printer know what paper to use (different input trays,...)?

> And before you ask, if I tell
> the printer it's A4 and set the print diaglogue to A4, then I get a printer
> jam because it thinks the paper's torn. So I admit the unnecessarily picky
> firmware on my printer doesn't help - and I've never had this issue before I
> bought this model. But nonetheless, I think there is a fault with the logic
> in LibreOffice here. Perhaps if specific page sizes are set up in the doc',
> then the print dialogue should not insist on an overall page size for the
> entire doc, which I agree is otherwise a useful thing to be able to do! I'm
> using Ubuntu 19.10 with the default printer driver "(Xerox Phaser 6510,
> driverless, cups-filters 1.25.11"). As mentioned, I can print non-standard
> sizes using AbiWord via the same printer driver as the print dialogue
> doesn't appear to require a paper size.

I've taken a quick look at what AbiWord does. As far as I could see, it explicitly makes it impossible to select the page size in any case and always uses that from the document and passes it to CUPS. I think this is usually what you want (and what I think LO does as well) when the document size is one that the printer supports.

It's cool this works nicely for your printer with non-supported page sizes as well in AbiWord and I understand you want to have it working for LibreOffice as well.
I still *think* this could cause trouble with other printers, however, just the same way it may fix your use case.

I have tested with a dummy printer here that only can print up to A4, and if the document has a size of A0, AbiWord just tells the printer to print on A0 anyway; from the CUPS log ("PageSize=A0") is the relevant parameter:

> D [24/Jun/2020:13:30:23 +0200] [Job 1476] argv[5]="StpFineInkLimit=None StpFineDensity=None StpImageType=TextGraphics StpGamma=None StpGreenGamma=None StpDensity=None StpBlueDensity=None Resolution=301x300dpi StpDitherAlgorithm=None StpFineGamma=None StpGreenDensity=None StpBrightness=None StpBlueGamma=None noStpLinearContrast StpFineRedDensity=None Duplex=DuplexNoTumble PageSize=A0 StpColorPrecision=Normal InputSlot=Standard StpQuality=Standard StpColorCorrection=None StpContrast=None StpFineContrast=None ColorModel=RGB StpiShrinkOutput=Crop StpFineGreenGamma=None StpFineBlueDensity=None StpRedGamma=None StpInkLimit=None noCollate StpRedDensity=None StpFineRedGamma=None StpFineBlueGamma=None number-up=1 StpFineBrightness=None StpFineGreenDensity=None job-uuid=urn:uuid:c88ed197-3cea-39a3-6967-415860f09c9d job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1592998223 time-at-processing=1592998223"

And when printing using a custom page size, that one is passed e.g. as "PageSize=Custom.566.93x566.93".

From what I remember, passing invalid PPD options leads to "undefined behaviour", which is usually undesirable. I remember for a different scenario and some Ricoh printer that passing some invalid parameters caused a paper jam there.


I'm wondering whether it'd be an option to "teach" your printer driver/PPD to support the page sizes you need by modifying its PPD file instead. What do you think?

Are there specific sizes you need support for? Can you attach your printer's PPD file?
Comment 9 QA Administrators 2020-12-22 03:43:19 UTC Comment hidden (obsolete)
Comment 10 Prichy 2021-01-05 21:56:36 UTC
(In reply to Michael Weghorn from comment #8)
> (In reply to Prichy from comment #7)
> > Hi all - not sure what specific info is required but here's more
> > explanation. I think this issue has come to light because I now have a very
> > picky printer (Xerox phaser 6510). The problem is that you have to tell it
> > what paper you've loaded. When you go to print, if the paper size 'required'
> > via the printyer dialogue doesn't match, what it has loaded, it refuses to
> > print - very annoying. So the problem is that although I can format a single
> > page to e.g. 144x144mm, LibreOffice then insists I select a 'standard' size
> > in the print dialogue - a size for the whole document it seems. 144x144
> > isn't an option on my driver. So it could be argued this is a fault with the
> > *printer driver* not allowing custom sizes - but even if that were possible,
> > how would it do it on a page-by-page basis?
> 
> Out of curiosity:
> Have you tried printing a document with different page sizes in LibreOffice
> and AbiWord? I'd really be interested what happens in both cases. Do you
> insert different sheets of paper in the order that the pages are to printed
> in this case, or how does the printer know what paper to use (different
> input trays,...)?
> 
> > And before you ask, if I tell
> > the printer it's A4 and set the print diaglogue to A4, then I get a printer
> > jam because it thinks the paper's torn. So I admit the unnecessarily picky
> > firmware on my printer doesn't help - and I've never had this issue before I
> > bought this model. But nonetheless, I think there is a fault with the logic
> > in LibreOffice here. Perhaps if specific page sizes are set up in the doc',
> > then the print dialogue should not insist on an overall page size for the
> > entire doc, which I agree is otherwise a useful thing to be able to do! I'm
> > using Ubuntu 19.10 with the default printer driver "(Xerox Phaser 6510,
> > driverless, cups-filters 1.25.11"). As mentioned, I can print non-standard
> > sizes using AbiWord via the same printer driver as the print dialogue
> > doesn't appear to require a paper size.
> 
> I've taken a quick look at what AbiWord does. As far as I could see, it
> explicitly makes it impossible to select the page size in any case and
> always uses that from the document and passes it to CUPS. I think this is
> usually what you want (and what I think LO does as well) when the document
> size is one that the printer supports.
> 
> It's cool this works nicely for your printer with non-supported page sizes
> as well in AbiWord and I understand you want to have it working for
> LibreOffice as well.
> I still *think* this could cause trouble with other printers, however, just
> the same way it may fix your use case.
> 
> I have tested with a dummy printer here that only can print up to A4, and if
> the document has a size of A0, AbiWord just tells the printer to print on A0
> anyway; from the CUPS log ("PageSize=A0") is the relevant parameter:
> 
> > D [24/Jun/2020:13:30:23 +0200] [Job 1476] argv[5]="StpFineInkLimit=None StpFineDensity=None StpImageType=TextGraphics StpGamma=None StpGreenGamma=None StpDensity=None StpBlueDensity=None Resolution=301x300dpi StpDitherAlgorithm=None StpFineGamma=None StpGreenDensity=None StpBrightness=None StpBlueGamma=None noStpLinearContrast StpFineRedDensity=None Duplex=DuplexNoTumble PageSize=A0 StpColorPrecision=Normal InputSlot=Standard StpQuality=Standard StpColorCorrection=None StpContrast=None StpFineContrast=None ColorModel=RGB StpiShrinkOutput=Crop StpFineGreenGamma=None StpFineBlueDensity=None StpRedGamma=None StpInkLimit=None noCollate StpRedDensity=None StpFineRedGamma=None StpFineBlueGamma=None number-up=1 StpFineBrightness=None StpFineGreenDensity=None job-uuid=urn:uuid:c88ed197-3cea-39a3-6967-415860f09c9d job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1592998223 time-at-processing=1592998223"
> 
> And when printing using a custom page size, that one is passed e.g. as
> "PageSize=Custom.566.93x566.93".
> 
> From what I remember, passing invalid PPD options leads to "undefined
> behaviour", which is usually undesirable. I remember for a different
> scenario and some Ricoh printer that passing some invalid parameters caused
> a paper jam there.
> 
> 
> I'm wondering whether it'd be an option to "teach" your printer driver/PPD
> to support the page sizes you need by modifying its PPD file instead. What
> do you think?
> 
> Are there specific sizes you need support for? Can you attach your printer's
> PPD file?

There are many page sizes I use - I need the ability to print new ones all the time and I don't think that changing the printer driver is an acceptable solution. The reason is I frequently print envelopes for greetings cards. There are many different shapes and sizes. So I was using a standard template with fields to pick up the address details from a database and then I'd change the page size to ensure the address is positioned in the correct place. But after changing the page size I then came up against this problem in the print dialogue which then overrides the page size. I'll attach the ppd
Comment 11 Prichy 2021-01-05 21:57:47 UTC
Created attachment 168710 [details]
The .ppd file for the printer as requested
Comment 12 Michael Weghorn 2021-01-18 09:49:55 UTC
(In reply to Prichy from comment #11)
> Created attachment 168710 [details]
> The .ppd file for the printer as requested

Thanks. That PPD actually explicitly specifies it supports custom page sizes:

> *ParamCustomPageSize Width: 1 points 216 612
> *ParamCustomPageSize Height: 2 points 360 1008
> *ParamCustomPageSize WidthOffset: 3 points 0 0
> *ParamCustomPageSize HeightOffset: 4 points 0 0
> *ParamCustomPageSize Orientation: 5 int 0 3
> *CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice"

It makes sense to support that at least for such PPDs IMHO.

In a quick test using a custom page size from Gedit (Gtk print dialog) and Kate (Qt print dialog), those passed 'PageSize=Custom.113.39x113.39' or 'media=Custom.40x40mm' to CUPS, which at a quick glance is what CUPS doc at [1] says:

> When Custom is listed for the PageSize option, you can specify custom media sizes using one of the following forms:
> 
> lp -o media=Custom.WIDTHxLENGTH filename
> lp -o media=Custom.WIDTHxLENGTHin filename
> lp -o media=Custom.WIDTHxLENGTHcm filename
> lp -o media=Custom.WIDTHxLENGTHmm filename



[1] https://www.cups.org/doc/options.html
Comment 13 Prichy 2021-01-18 17:38:56 UTC
So just to be clear - are we agreeing that this is something new that LibreOffice should or could support? Unless I'm missing something (which is possible because I don't use LibreOffice very often), I cannot figure out how to select anything but the standard media sizes in the print dialogue - which is what then confuses the printer. Thank you!
Comment 14 Michael Weghorn 2021-01-19 08:14:48 UTC
(In reply to Prichy from comment #13)
> So just to be clear - are we agreeing that this is something new that
> LibreOffice should or could support? Unless I'm missing something (which is
> possible because I don't use LibreOffice very often), I cannot figure out
> how to select anything but the standard media sizes in the print dialogue -
> which is what then confuses the printer. Thank you!

Yes, we agree that this is something that makes sense for LibreOffice to support. It doesn't work yet, that would have to be implemented first.