Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Debenu Quick PDF Library 11 don't support A6?
  FAQ FAQ  Forum Search   Register Register  Login Login

Debenu Quick PDF Library 11 don't support A6?

 Post Reply Post Reply
Author
Message
shawn View Drop Down
Beginner
Beginner


Joined: 01 Dec 15
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote shawn Quote  Post ReplyReply Direct Link To This Post Topic: Debenu Quick PDF Library 11 don't support A6?
    Posted: 01 Dec 15 at 2:41PM
Hi,
I use Debenu Quick PDF Library 11 for printing. It seems the library doesn't support paper size from 69 to 118(A6 is 70). To be specific, I use SetupCustomPrinter() set paper size and it always return 0 for the above paper size. 

I am wondering whether it is a limitation of Debenu Quick PDF Library 11 or a bug?
If it is a limitation, does Debenu Quick PDF Library 12 support paper size from 69 to 118. 

Thanks ahead!
Back to Top
shawn View Drop Down
Beginner
Beginner


Joined: 01 Dec 15
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote shawn Quote  Post ReplyReply Direct Link To This Post Posted: 01 Dec 15 at 2:52PM
From document, it seems SetupCustomPrinter() only support paper size from 1 to 68. And we need set paper height and width if customer size is needed?
Back to Top
LuProch View Drop Down
Beginner
Beginner
Avatar

Joined: 01 Feb 13
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote LuProch Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jan 18 at 10:22AM
I had the same problem - to print a pre-existing PDF file in A6 portrait format to a printer to the same paper format. The idea was to put the A6 paper to the center of the A4 paper tray. I use the newest version of Quick PDF Library - 14.11.

First I tried to use the DMPAPER code. This doesn't work, because the SetupCustomPrinter function accepts only values 1 to 68.

quickPDF.SetupCustomPrinter(customPrinter, 1, 70); // 1 - paper size, 70 - A6


Then I tried to set the size in millimetres. This worked only with a virtual printer (to PDF), but not with a physical printer (to paper). I tried three different physical printers and it always printed to the top left corner of A4. (There was a bug in older Quick PDF versions, where SetupCustomPrinter(customPrinter, 1, 0) returned 0. This is fixed in newer versions, where it returns 1. But functionality stays the same.)

quickPDF.SetupCustomPrinter(customPrinter, 1, 0); // 1 - paper size, 0 - specify custom size
quickPDF.SetupCustomPrinter(customPrinter, 2, 1480); // 2 - paper length, 148 mm
quickPDF.SetupCustomPrinter(customPrinter, 3, 1050); // 3 - paper width, 105 mm


Finally I discovered a workaround. You can alter the PDF itself - add new A4 page, cut the A6 page (or basically any page size) and paste it into the top of the new A4 page, where you center it horizontally. Then you print the resulting A4 page normally and put A6 paper to the center of the A4 paper tray. You can just print and not save the changes to file, the original PDF file stays unchanged. Here is my code (simplified for document with only one page):

quickPDF.LoadFromFile(pdfPathName, ""); // file, password

quickPDF.SetOrigin(1); // origin of coordinates - top left
quickPDF.SetMeasurementUnits(1); // measure in millimetres

double outputPageWidth = 210.0; // A4 page width
double outputPageHeight = 297.0; // A4 page height

quickPDF.SelectPage(1); // select first page
double inputPageWidth = quickPDF.PageWidth();
double inputPageHeight = quickPDF.PageHeight();

quickPDF.NewPage(); // insert new page
quickPDF.SetPageDimensions(outputPageWidth, outputPageHeight); // set size of new page - A4 portrait

int captureID = quickPDF.CapturePage(1); // capture first page, also removes page from document

quickPDF.SelectPage(1); // select new page (now first page)
quickPDF.DrawCapturedPage(captureID, (outputPageWidth - inputPageWidth) / 2.0, 0, inputPageWidth, inputPageHeight); // draw captured page into new page - horizontally center, vertically top

string customPrinter = quickPDF.NewCustomPrinter(printerName); // printer name

quickPDF.SetupCustomPrinter(customPrinter, 9, paperSource); // paper source
quickPDF.SetupCustomPrinter(customPrinter, 1, 9); // paper size - A4
quickPDF.SetupCustomPrinter(customPrinter, 11, 1); // orientation - portrait

int options = quickPDF.PrintOptions(0, 0, documentName); // fit/shrink - no, rotate/center - no, document title

if (quickPDF.PrintDocument(customPrinter, 1, 1, options) == 0) // print one page
{
    // handle error
}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store