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!
![]() |
Change paper size problem |
Post Reply ![]() |
Author | |
mythcyrax ![]() Beginner ![]() ![]() Joined: 29 Sep 10 Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() Posted: 29 Sep 10 at 11:11AM |
Hello, In my application I need to print PDF documents on different paper sizes (A1, A3, A4...). The problem is that I cannot change the printer's default paper size. What am I doing wrong? void QuickPDF_Print(){ QuickPDFAX0721. PDFLibrary qp = new QuickPDFAX0721.PDFLibrary(); int result = qp.UnlockKey("my key..."); if (result == 1){ // Load the document that you want to print into memoryqp.LoadFromFile(Filename); qp.SetPageSize("A4");
// Set the paramters for the PrintDocument function
string PrinterName = PrintingOptions.Printer;
int StartPage = 1; // Set first page number
int EndPage = qp.PageCount(); // Set last page number
// Set the paramters for the PrintOptions function
int PageScaling = 1;
int AutoRotateCenter = 1;
string Title = Filename;
// Assign the options for printing to an int variable
int Options = qp.PrintOptions(PageScaling, AutoRotateCenter, Title);
// Print the document with the required paramters and options specified
qp.PrintDocument(PrinterName, StartPage, EndPage, Options); } } |
|
![]() |
|
Rowan ![]() Moderator Group ![]() ![]() Joined: 10 Jan 09 Status: Offline Points: 398 |
![]() ![]() ![]() ![]() ![]() |
To acoomplish what you're trying to do you'll need to use the custom printer functions. NewCustomPrinter SetupCustomPrinter Some info on the custom printer functions here: And here is some JScript sample code which demonstrates how to use the functions: -------------------------------------------------------- /* Create a custom printer and specify your own settings */ // Load a sample file from the input folder QP.LoadFromFile(GetInputFolder() + "JavaScript.pdf"); // Create the custom printer CustomPrinter = QP.NewCustomPrinter("Microsoft XPS Document Writer"); // Setup the settings for the customer printer // Medium quality QP.SetupCustomPrinter(CustomPrinter, 5, 2); // Monochrome QP.SetupCustomPrinter(CustomPrinter, 6, 1); // Horizontal Duplex QP.SetupCustomPrinter(CustomPrinter, 7, 3); // Configure print options iPrintOptions = QP.PrintOptions(0, 0, "Printing Sample"); // Print the current document to the default printing // using the options as configured above QP.PrintDocument(CustomPrinter, 1, 1, iPrintOptions); -------------------------------------------------------- So you need to setup the printer and the paper size for your customer printer before you call the PrintDocument function.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store