avoid oversized pages

View: New views
11 Messages — Rating Filter:   Alert me  

avoid oversized pages

by Maarten Bosteels-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Acrobat Reader has the option to "shrink oversized pages to paper size"
(on Windows it's called "Fit to paper" or "Shrink large pages").
How can I create pdf documents that do not need shrinking ?
Depending on the chosen printer, the document will be scaled to 96% or 94%.

I am adding a barcode in the lower right corner of the page using
image.setAbsolutePosition(x,y)
Everything is ok when I check "fit to paper",  but with option turned
off the barcode is only partially printed.

I guess it has something to do with the printer's margins ?
Even if I create a document with only a newline or a single letter,
Acrobat wants to shrink it.

Thanks,
Maarten


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Re: avoid oversized pages

by Bruno Lowagie (iText) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

maarten wrote:

> Acrobat Reader has the option to "shrink oversized pages to paper
> size" (on Windows it's called "Fit to paper" or "Shrink large pages").
> How can I create pdf documents that do not need shrinking ?
> Depending on the chosen printer, the document will be scaled to 96% or
> 94%.
>
> I am adding a barcode in the lower right corner of the page using
> image.setAbsolutePosition(x,y)
> Everything is ok when I check "fit to paper",  but with option turned
> off the barcode is only partially printed.
>
> I guess it has something to do with the printer's margins ?
> Even if I create a document with only a newline or a single letter,
> Acrobat wants to shrink it.

Adding a line to set the viewer preferences like this:
PdfWriter writer = PdfWriter.getInstance(doc, os);
writer.setViewerPreferences(PdfWriter.printScalingNone);
will tell Adobe Reader the document shouldn't be 'fit to paper'.

met vriendelijke groet,
Bruno


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Parent Message unknown Re: avoid oversized pages

by Bruno Lowagie (iText) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

maarten wrote:

> I suppose the ViewerPreferences don't really change the content of the
> document ?

No, that's the idea of Viewer Preferences.

> It should just switch on or off the option to scale the document, right ?

Yep, that's what the PrintScaling option is about.

> a) this is not what I'm looking for:

I get a lot of mail. I don't always read them as thoroughly as I should.

>   I would like to create an A4 document that does NOT NEED scaling,
>  in other words:  I would like that checking the option in the print
> dialog on or off doesn't make a difference.
>
> Is it really not possible to create a document that does not need
> scaling (even when nothing is close to the page border) ?

I don't think I understand.
If a page is A4 and your printer prints on A4 paper,
the printer isn't supposed to do any scaling,
Of course you are dependent on your printer driver.
That driver can be the cause of your problem.

Paulo, Leonard, do you know if setting a cropbox,
trimbox, bleedbox,... could solve this kind of problem?

> b) calling writer.setViewerPreferences(PdfWriter.printScalingNone)  
> doesn't seem to make any difference
> except that Acrobat Reader shows "Navigation Tabs" when I open the
> document.

Are you sure? I'll test it this afternoon.

> PS:  gefeliciteerd met uw prachtige open-source library !

Dank u zeer.
Bruno


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Parent Message unknown Re: avoid oversized pages

by Bruno Lowagie (iText) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

maarten wrote:

> calling writer.setViewerPreferences(PdfWriter.printScalingNone)  
> doesn't seem to make any difference
> except that Acrobat Reader shows "Navigation Tabs" when I open the
> document.

You have found a bug in iText.

The value for PageModeUseOC and PrintScalingNone was identical.
That way, when you set printscaling to none, you also set the page mode
to show the optional content layers. I have corrected this
(I mad a version iText 1.3.(2 and a half) that isn't released yet)
and I added an example here:
http://itextdocs.lowagie.com/tutorial/objects/bookmarks/
If you print
http://itextdocs.lowagie.com/tutorial/objects/bookmarks/TwoColumnLeft.pdf
the pages may be scaled (resulting in a very big font).
If you print
http://itextdocs.lowagie.com/tutorial/objects/bookmarks/NoScaling.pdf
on a sheet of paper with size A4, the original A6 size is kept,
and the page is centered on the A4 page.

This doesn't solve your problem yet, but I am hoping people
who know more about printer drivers will be able to answer
your question on how to avoid them scaling your page.

br,
Bruno


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Re: avoid oversized pages

by Leonard Rosenthol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 06:50 AM 8/10/2005, bruno wrote:
>>   I would like to create an A4 document that does NOT NEED scaling,
>>  in other words:  I would like that checking the option in the
>> print dialog on or off doesn't make a difference.

         That doesn't make any sense...

         As Bruno noted, if your document is A4 and you print to A4
paper - then there won't be any scaling necessary (assuming the
printer has minimal hardware margins).

         But, as you might expect, if you print that to a US printer - it will.


>Of course you are dependent on your printer driver.
>That driver can be the cause of your problem.

         Another excellent point.


Leonard

---------------------------------------------------------------------------
Leonard Rosenthol                            <mailto:leonardr@...>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-938-7080 (voice)
                                              215-938-0880 (fax)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Parent Message unknown Re: avoid oversized pages

by Bruno Lowagie (iText) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The idea is to keep on the mailing list ;-)

maarten wrote:

> I have the impression that Acrobat Reader (I tested 6.0.0 on Windows
> and 7.0.0 on Linux)
> just remembers the latest setting of "Page Scaling"

Normally yes.

> and ignores the viewer preference (for this particular option).

Normally no: if the printscaling option is set to NONE internally,
Adobe Reader should 'obey' it, BUT: the print scaling option
is rather recent (PDF 1.5? I only have my 1.4 Reference Manual
here, I left my 1.6 Manual at home), so older Readers may ignore it.

> Printing
> http://itextdocs.lowagie.com/tutorial/objects/bookmarks/NoScaling.pdf 
> on a sheet of paper with size A4
> with (option "No scaling") gives the following results :
> * from linux on OKI with PCL5c driver        => A6 size in upper left
> corner of A4 page
> * from linux on OKI with PCL5e driver        => A6 size in upper left
> corner of A4 page
> * from linux on OKI with Postscript driver    => A6 size in upper left
> corner of A4 page
> * from linux on HP OKI with Postscript driver => A6 size in upper left
> corner of A4 page
> * from Windows on OKI with OKI driver  =>   A6 size centered on A4
> page (after canceling error message on printer)
> * from Windows on HP with PS driver      =>  A6 size centered on A4 page


> I was also suspecting printer drivers but I have the same issue on
> Windows and Linux
> on two different printers (an OKI C7200 and an HP 4500TN)
>
> If I want to print  
> http://itextdocs.lowagie.com/tutorial/general/HelloWorld.pdf
> and set the Page scaling option to "Fit to page", the preview on the
> right shows "Zoom:  91%"
>
> Is this different on your system/printers ?

Not really.
In my case, setting the Page Scaling to 'Fit to printer margins' shows a
zoom of 96%.
As you are talking about "Fit to page", I wonder: what Adobe Reader
version are you using?
br,
Bruno


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Re: avoid oversized pages

by Leonard Rosenthol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 09:05 AM 8/10/2005, bruno wrote:
>Normally no: if the printscaling option is set to NONE internally,
>Adobe Reader should 'obey' it, BUT: the print scaling option
>is rather recent (PDF 1.5? I only have my 1.4 Reference Manual
>here, I left my 1.6 Manual at home), so older Readers may ignore it.

         It's new to 1.6 (Acrobat 7).


>>Printing
>>http://itextdocs.lowagie.com/tutorial/objects/bookmarks/NoScaling.pd 
>>f on a sheet of paper with size A4
>>with (option "No scaling") gives the following results :
>>* from linux on OKI with PCL5c driver        => A6 size in upper
>>left corner of A4 page
>>* from linux on OKI with PCL5e driver        => A6 size in upper
>>left corner of A4 page
>>* from linux on OKI with Postscript driver    => A6 size in upper
>>left corner of A4 page
>>* from linux on HP OKI with Postscript driver => A6 size in upper
>>left corner of A4 page

         OK - that sounds correct.  It didn't scale and the printer
driver choose to place it in the upper left.


>>* from Windows on OKI with OKI driver  =>   A6 size centered on A4
>>page (after canceling error message on printer)
>>* from Windows on HP with PS driver      =>  A6 size centered on A4 page

         You probably have the "Auto-Rotate & Center" option enabled
(it is by default).   And again, it isn't scaling...

         So this all looks good...


Leonard

---------------------------------------------------------------------------
Leonard Rosenthol                            <mailto:leonardr@...>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-938-7080 (voice)
                                              215-938-0880 (fax)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Re: avoid oversized pages

by Maarten Bosteels-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Leonard Rosenthol wrote:

> At 06:50 AM 8/10/2005, bruno wrote:
>
>>>   I would like to create an A4 document that does NOT NEED scaling,
>>>  in other words:  I would like that checking the option in the print
>>> dialog on or off doesn't make a difference.
>>
>
>         That doesn't make any sense...
>
>         As Bruno noted, if your document is A4 and you print to A4
> paper - then there won't be any scaling necessary (assuming the
> printer has minimal hardware margins).

I know, that's exactly what I expected:  creating a A4 document and
printing it to an A4 paper : no need to scale
but unfortunately reality is different.

>
>         But, as you might expect, if you print that to a US printer -
> it will.

I am definitely printing to A4 paper

>
>
>> Of course you are dependent on your printer driver.
>> That driver can be the cause of your problem.
>
>
>         Another excellent point.
>
Yes, I agree, but I tried it with 2 different printers with many
different drivers (from both linux and unix)
I am starting to suspect that our printerserver/spooler has something to
do with it.
Tonight I will try it out on my personal inkjet printer (directly
connected to my pc).

regards,
Maarten


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Re: avoid oversized pages

by Maarten Bosteels-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Leonard Rosenthol wrote:

> At 09:05 AM 8/10/2005, bruno wrote:
>
>> Normally no: if the printscaling option is set to NONE internally,
>> Adobe Reader should 'obey' it, BUT: the print scaling option
>> is rather recent (PDF 1.5? I only have my 1.4 Reference Manual
>> here, I left my 1.6 Manual at home), so older Readers may ignore it.
>
>
>         It's new to 1.6 (Acrobat 7).
>
Yes, I also found it in the Pdf Reference 1.6, and it works in Acrobat 7
on Windows, but not in Acrobat 7 on linux.

>
>>> Printing
>>> http://itextdocs.lowagie.com/tutorial/objects/bookmarks/NoScaling.pd 
>>> f on a sheet of paper with size A4
>>> with (option "No scaling") gives the following results :
>>> * from linux on OKI with PCL5c driver        => A6 size in upper
>>> left corner of A4 page
>>> * from linux on OKI with PCL5e driver        => A6 size in upper
>>> left corner of A4 page
>>> * from linux on OKI with Postscript driver    => A6 size in upper
>>> left corner of A4 page
>>> * from linux on HP OKI with Postscript driver => A6 size in upper
>>> left corner of A4 page
>>
>
>         OK - that sounds correct.  It didn't scale and the printer
> driver choose to place it in the upper left.
>
* from Windows on OKI with OKI driver  =>   A6 size centered on A4 page
(after canceling error message on printer)

>>> * from Windows on HP with PS driver      =>  A6 size centered on A4
>>> page
>>
>
>         You probably have the "Auto-Rotate & Center" option enabled
> (it is by default).   And again, it isn't scaling...
>
>         So this all looks good...
>
Indeed, this looks good, I just wanted to point out to Bruno that
doesn't always print in the center
although I always had the "Auto-Rotate & Center" option enabled.




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Re: avoid oversized pages

by Maarten Bosteels-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

bruno wrote:

> The idea is to keep on the mailing list ;-)

oops, sorry

>> If I want to print  
>> http://itextdocs.lowagie.com/tutorial/general/HelloWorld.pdf
>> and set the Page scaling option to "Fit to page", the preview on the
>> right shows "Zoom:  91%"
>>
>> Is this different on your system/printers ?
>
>
> Not really.
> In my case, setting the Page Scaling to 'Fit to printer margins' shows
> a zoom of 96%.
> As you are talking about "Fit to page", I wonder: what Adobe Reader
> version are you using?
> br,
> Bruno
>
Every version seems to have different options:
a) Acrobat Standard 6.0 on Windows :  None, Fit to paper, Shrink large
pages, Tile large pages, Tile all pages
b) Acrobat Reader 6.0 on Windows    : None, Fit to paper, Shrink large pages
c) Acrobat 7.0 on Windows:  None, Fit to printer margins, Reduce to
printer margins, Multiple pages per sheet
d) Acrobat 7.0 on Linux :  two checkboxes :   Shrink oversized pages to
paper size + Expand small pages to paper size
 
Also  on linux there  is no preview box and no indication on how much
zooming will be performed.

Maarten


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Re: avoid oversized pages

by mcevikce :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How can I disbale Auto-Rotate and Center?
Maarten Bosteels-3 wrote:
Leonard Rosenthol wrote:

> At 09:05 AM 8/10/2005, bruno wrote:
>
>> Normally no: if the printscaling option is set to NONE internally,
>> Adobe Reader should 'obey' it, BUT: the print scaling option
>> is rather recent (PDF 1.5? I only have my 1.4 Reference Manual
>> here, I left my 1.6 Manual at home), so older Readers may ignore it.
>
>
>         It's new to 1.6 (Acrobat 7).
>
Yes, I also found it in the Pdf Reference 1.6, and it works in Acrobat 7
on Windows, but not in Acrobat 7 on linux.

>
>>> Printing
>>> http://itextdocs.lowagie.com/tutorial/objects/bookmarks/NoScaling.pd 
>>> f on a sheet of paper with size A4
>>> with (option "No scaling") gives the following results :
>>> * from linux on OKI with PCL5c driver        => A6 size in upper
>>> left corner of A4 page
>>> * from linux on OKI with PCL5e driver        => A6 size in upper
>>> left corner of A4 page
>>> * from linux on OKI with Postscript driver    => A6 size in upper
>>> left corner of A4 page
>>> * from linux on HP OKI with Postscript driver => A6 size in upper
>>> left corner of A4 page
>>
>
>         OK - that sounds correct.  It didn't scale and the printer
> driver choose to place it in the upper left.
>
* from Windows on OKI with OKI driver  =>   A6 size centered on A4 page
(after canceling error message on printer)

>>> * from Windows on HP with PS driver      =>  A6 size centered on A4
>>> page
>>
>
>         You probably have the "Auto-Rotate & Center" option enabled
> (it is by default).   And again, it isn't scaling...
>
>         So this all looks good...
>
Indeed, this looks good, I just wanted to point out to Bruno that
doesn't always print in the center
although I always had the "Auto-Rotate & Center" option enabled.




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions