Components for Developers
© 2000-2017, Two Pilots

PDF Library   EMF2PDF SDK Pilot   Virtual Printers   HTML2PDF-X Pilot   Converters   PDF Mosaic  
Home Download Features Manual Tutorials FAQ Pricing History In the Lab

 

How to print a PDF document

 

This sample illustrates how to print a PDF document using the default printer. (The process is similar for any other specified printer.) You can use PDF Creator Pilot's printing functionality independent of on any third party components.

For printing a PDF document with the help of PDF Creator Pilot, use the DrawPageToDC method. This method draws a specified PDF page to a device context. The method takes the following 5 parameters:

hdc
  Handle of the device context

pageNumber
  Number of target page

zoomX
  Horizontal zoom

zoomY
  Vertical zoom

drawControls
  Draw controls

So, to print the PDF document on the printer, you need to get the device context of the printer and then call the DrawPageToDC method with the specified parameters.

Below you can download samples, demonstrating how to print a PDF document in C++, C#, and VB.Net.

 

Download Sample Code

Print a PDF document using C/C++ (35Kb)

Print a PDF document using C# (17Kb)

Print a PDF document using VB.NET (23Kb)

 

See also

How to Add and Delete PDF Pages
How to Change Character Spacing
How to Change Metadata of a PDF Document
How to Change Text Rise
How to Create a Button
How to Create a CheckBox
How to Create a ComboBox
How to Create a ListBox
How to create a new PDF document
How to create a Sound (Audio) Annotations in PDF document
How to Create Dash Pattern
How to Create Edit Boxes
How to Create Fillable PDF Forms
How to Create Graphics in PDF Document Using Patterns
How to Create Gray Color Space in PDF and Draw Graphics Elements
How to Create Layers (Optional Contrent Groups) in PDF
How to Create RGB Color Space in PDF and Draw Rectangles
How to draw simple elements, such as a line and cubic Bezier curves
How to draw simple elements, such as a rectangle and ellipses
How to Increase Or Decrease The Size Of a Text Line Using Horizontal Scaling
How to Insert an Image into a PDF
How to manipulate primitives to clip drawing objects
How to Open a Existing PDF Document
How to place a Attachments into PDF document
How to Protect Your PDF Document With a Password
How to Save And Restore Graphics State
How to Scale and Translate Coordinates
How to Specify Text Rendering Mode
How to Submit and Reset Form Actions
How to Use Blend Modes
How to Use Fonts
How to Write Text in a PDF Document
How to extract text from PDF documents
How to place a Attachments into PDF document
How to create a Sound Annotations in PDF document
How to print a PDF document

Home Download Features Manual Tutorials FAQ Pricing History In the Lab

 

PDF Library | EMF2PDF SDK Pilot | Virtual Printers
HTML2PDF-X Pilot | Converters | PDF Mosaic

Support | Blog
Contact | About | Site map

© 2000-2017, Two Pilots