Print Page | Close Window

Printing - Fit Document

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3486
Printed Date: 26 Nov 24 at 5:01AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Printing - Fit Document
Posted By: davidgm
Subject: Printing - Fit Document
Date Posted: 20 Jul 17 at 11:34AM
Hello,

I got a PDF document with a paper size of 140x210mm.

I use the following code to print to A4 (210x297 mm):

                        var custom = QP.NewCustomPrinter("My Printer");
                        var iPrintOptions = QP.PrintOptions(0, 0, "Printing Sample");
                        QP.PrintDocument(custom, 1, 1, iPrintOptions);

The document is printed, and it does not fit the page fully, as expected.

If i try to change the print options, according to the documentation i should set PageScaling to 1 to Fit to Paper:

                        var iPrintOptions = QP.PrintOptions(1, 0, "Printing Sample");

I execute the code, and the document is printed, but, it does not fit the page "correctly".

The size of the document is increased from 140x210 to 210x297, but it is "cropped" to (0,0,140,297), and the area outside this box is white.

Is there a way to fit the document properly to an A4 ?

Thank you very much




Replies:
Posted By: Ingo
Date Posted: 20 Jul 17 at 12:58PM
Hi David,

option "fit to page" will try to fit all sides
but it will keep always the original aspect ratio.
Due to this it won't be possible to morph 140x210 to 210x297.

Cheers and welcome here,
Ingo




-------------
Cheers,
Ingo



Posted By: davidgm
Date Posted: 20 Jul 17 at 5:19PM
I understand.

What about if i set a paper size manually, that keeps the original aspect ratio of the document, but fits as max as possible into an A4 ?

Thank you.


Posted By: Ingo
Date Posted: 20 Jul 17 at 7:16PM
These two categories will help:
http://www.debenu.com/docs/pdf_library_reference/RenderingAndPrinting.php
http://www.debenu.com/docs/pdf_library_reference/ImageHandling.php
If there are further probs you can search here:
http://www.debenu.com/docs/pdf_library_reference/Search.php



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk