Tutorial - Printing Documents

Top  Previous  Next

This program demonstrates how to use gtPDFPrinterX and its properties to set printing formats for the document to be printed.

 

[VB]

 

PDFDoc.LoadFromFile ("InputFile1")

PDFPrinter.PDFDocument = PDFDoc

PDFPrinter.Collate = False

PDFPrinter.Copies = 2

PDFPrinter.FromPage = 2

PDFPrinter.ToPage = 5

PDFPrinter.PrintRange = TxPrintRange.prPageNums

PDFPrinter.Scaling = TxgtPDFPageScaling.psFitPage

PDFPrinter.ShowSetupDialog = True

PDFPrinter.TextOutputPrecision = TxgtTextOutputPrecision.tpAlignment

PDFPrinter.PrintDoc

 

[VC++]

 

PDFDoc.LoadFromFile("InputFile1");

LPUNKNOWN pUnKnown = PDFDoc.GetControlUnknown();

PDFPrinter.SetPDFDocument((LPDISPATCH)pUnKnown);

PDFPrinter.SetPrintRange(1);

PDFPrinter.SetToPage(1);

PDFPrinter.SetFromPage(3);

PDFPrinter.SetCollate(True);

PDFPrinter.PrintDoc();

 

 

[CS]

 

PDFDoc.LoadFromFile(InputFile1);

PDFPrinter.PDFDocument = (gtPDFDocumentX) PDFDoc.GetOcx();

PDFPrinter.Collate = False;

PDFPrinter.Copies = 2;

PDFPrinter.FromPage = 2;

PDFPrinter.ToPage = 5;

PDFPrinter.PrintRange = TxPrintRange.prPageNums;

PDFPrinter.Scaling = TxgtPDFPageScaling.psFitPage;

PDFPrinter.ShowSetupDialog = True;

PDFPrinter.TextOutputPrecision = TxgtTextOutputPrecision.tpAlignment;

PDFPrinter.PrintDoc();

 

 

[VB.net]

 

Dim PDFDocument As New PDFtoolkitX.gtPDFDocumentX

Dim PDFPrinter As New PDFtoolkitX.gtPDFPrinterX

 

PDFDocument.LoadFromFile("Input.pdf")

PDFPrinter.PDFDocument = PDFDocument

 

PDFPrinter.PrintRange = TxPrintRange.prAllPages

PDFPrinter.Copies = 2

PDFPrinter.Collate = False   

 

PDFPrinter.PrintDoc()