[ 
https://issues.apache.org/jira/browse/PDFBOX-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14027279#comment-14027279
 ] 

John Hewson edited comment on PDFBOX-2119 at 6/11/14 12:57 AM:
---------------------------------------------------------------

{quote}
I didn't see the point why one should override the orientation?
{quote}

It's for print preview and virtual printers such as XPS.

{quote}
What exactly should be returned when calling getPageFormat? It can't be 
defaultPage() + orientation, that doesn't make sense either.
{quote}

Using defaultPage() makes sense, because we also allowed a custom Paper to be 
set by the user, so that they can override it. Otherwise the paper format is 
the default available on the printer. Also, I just realised, you also removed 
the ability to use a custom Paper that was recently added - why?

What you've done with getPageFormat() is simply to return the size of the PDF's 
media box, which might not be supported by the printer, in which case 
validatePage() will return a smaller box. That smaller box will just be 
defaultPage() anyway so nothing is achieved. There's an additional problem: if 
the media box is smaller than defaultPage() then what does validatePage() 
return? In the best case it will return the closest available paper size with 
the pritable area shrunk to fit the crop box - but that's not what you want, 
because it breaks the STRETCH_TO_FIT scaling mode which was recently added, 
because now the page's actual printable area has been artificially reduced, so 
in print() we can no longer print at any scale other than 100% as was defined 
by the PDF's media box.

{quote}
BTW, I'm printing to a zebra label printer using PDFBox 1.8.5 incl. that 
implementattion as patch
{quote}

Where exactly does the user provide a paper size in Tilmans explaination?

Sorry I meant PrintService, not Paper. Although custom Paper was available in 
the last revision!

1.8.5 does things differently anyway, so it doesn't matter - it's 2.0 that I'm 
referring to.


was (Author: jahewson):
{quote}
I didn't see the point why one should override the orientation?
{quote}

It's for print preview and virtual printers such as XPS.

{quote}
What exactly should be returned when calling getPageFormat? It can't be 
defaultPage() + orientation, that doesn't make sense either.
{quote}

Using defaultPage() makes sense, because we also allowed a custom Paper to be 
set by the user, so that they can override it. Otherwise the paper format is 
the default available on the printer. Also, I just realised, you also removed 
the ability to use a custom Paper that was recently added - why?

What you've done with getPageFormat() is simply to return the size of the PDF's 
media box, which might not be supported by the printer, in which case 
validatePage() will return a smaller box. That smaller box will just be 
defaultPage() anyway so nothing is achieved. There's an additional problem: if 
the media box is smaller than defaultPage() then what does validatePage() 
return? In the best case it will return the closest available paper size with 
the pritable area shrunk to fit the crop box - but that's not what you want, 
because it breaks the STRETCH_TO_FIT scaling mode which was recently added, 
because now the page's actual printable area has been artificially reduced.

{quote}
BTW, I'm printing to a zebra label printer using PDFBox 1.8.5 incl. that 
implementattion as patch
{quote}

Where exactly does the user provide a paper size in Tilmans explaination?

Sorry I meant PrintService, not Paper. Although custom Paper was available in 
the last revision!

1.8.5 does things differently anyway, so it doesn't matter - it's 2.0 that I'm 
referring to.

> Possible printing bug for V2.00
> -------------------------------
>
>                 Key: PDFBOX-2119
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2119
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Window 7 Professional SP1, JRE 8.
>            Reporter: You Liang
>            Assignee: Andreas Lehmkühler
>              Labels: pdfbox, printer, printing
>             Fix For: 1.8.6, 2.0.0
>
>
> Printing seems to be using the window default printer paper size instead of 
> selected printService papersize.
> Etc my default Printer is an A4 Printer, and the printer that i had choosen 
> to print is a receipt printer.
> When i print to the receipt printer, it will print out a blown up version of 
> the original pdf, and when i change my default printer to the receipt 
> printer.. everything work fine.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to