Print Page | Close Window

PDFLibrary.PrintDocument with blanc page

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=3096
Printed Date: 28 Apr 24 at 7:34AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PDFLibrary.PrintDocument with blanc page
Posted By: iosam
Subject: PDFLibrary.PrintDocument with blanc page
Date Posted: 26 Mar 15 at 5:22PM
I use PDFLibrary.PrintDocument and when I execute my function the printed page is only white.

Here is my code to print a pdf from a Memorystream

DFLibrary.LoadFromStream(PDFStream, '');
printoptions := PDFLibrary.PrintOptions(1, 0, '');
nret := PDFLibrary.PrintDocument(printer, 1, 1, printoptions);

is there something that I forgot?









Replies:
Posted By: Rowan
Date Posted: 29 Mar 15 at 1:09PM
I would suggest making a call to http://www.debenu.com/docs/pdf_library_reference/RenderDocumentToFile.php" rel="nofollow - RenderDocumentToFile  after the LoadFromStream call to ensure that the PDF can be successfully rendered to an image. That will confirm whether the file is loading and rendering correctly. If that is successful then the problem obviously lies with the printing side of things.

When displaying an image of a PDF onscreen or printing one to paper the same rendering process is required, so this will help to see where the problem is.


Posted By: agat
Date Posted: 18 Jun 15 at 12:17PM
I have similar problem. I'm trying to print pdf file with printDocument function.
This document is supposed have an image (it is a scan) on the first page and a text on the second page.

The problem is that printout contains first blank page where supposed to be an image (the second page is correctly filled with text)

I tried to use renderDocumentToFile function and it gives same result.
When I just save the document and reopen, both text and image are present.

my code:

  var QP = new QuickPDF();
  DebenuPDFLibraryDLL1014.PDFLibrary pdf = QP.unlockLibrary();

  string f = "C:\temp\file.pdf";   
  pdf.LoadFromFile(f, "");
  int n = pdf.PageCount();
  string printer = pdf.GetDefaultPrinterName(); 
  int result = pdf.PrintDocument(printer, 1, n, 0);






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