Print Page | Close Window

Emulating A Printer

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2731
Printed Date: 31 May 25 at 11:49AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Emulating A Printer
Posted By: BirdGuy66
Subject: Emulating A Printer
Date Posted: 13 Sep 13 at 6:42PM
Hi,

I'm adding the ability to an application to output reports to PDF. Current that application only outputs to a printer using to standard GDI functions. To implement this, I've changed the printing code to create wrappers for the GDI Print API functions StartDoc, EndDoc, StartPage, EndPage. When printing to a to printer, the wrappers behave as expected but when outputting to a PDF file, they call QuickPDF library functions. The document is created but with only the first page. Here is the sequences of QuickPDF calls:

  1. QP.GetCanvasDC(10200, 13200);            // initialization
  2. // GDI operations on Canvas DC for first page
  3. QP.LoadFromCanvasDC(1200.0, 3);         // called on first EndPage invocation
  4. // GDI operations on Canvas DC for second page
  5. QP.NewPageFromCanvasDC(1200.0, 3);  // called on subsequent EndPage invocation
  6. QP.SaveToFile("Report.pdf");                    // called on EndDoc invocation

I should note that the call to NewPageFromCanvasDC fails which leads me to believe this is the wrong sequence of functions or that I'm missing some function calls to do what I need to do.

Any ideas? Thanks,

- Rich




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk