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 - Change paper size problem
  FAQ FAQ  Forum Search   Register Register  Login Login

Change paper size problem

 Post Reply Post Reply
Author
Message
mythcyrax View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Sep 10
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote mythcyrax Quote  Post ReplyReply Direct Link To This Post Topic: Change paper size problem
    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 memory

qp.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);

}

}

Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 10 at 2:04PM
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.
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