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 - Printing PDF results in blank print
  FAQ FAQ  Forum Search   Register Register  Login Login

Printing PDF results in blank print

 Post Reply Post Reply
Author
Message
ryan.cole View Drop Down
Beginner
Beginner


Joined: 23 Aug 10
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote ryan.cole Quote  Post ReplyReply Direct Link To This Post Topic: Printing PDF results in blank print
    Posted: 23 Aug 10 at 8:47PM
Hello,

I was using QuickPDF0719 and just updated to the QuickPDF0721. My following issue existed in both versions.

I'm using QuickPDF to open and send a PDF to a printer driver. The printer driver then saves the print job as a TIFF image. I have tested printing PDFs to the print driver using Acrobat Reader and they come out fine.

I am having a problem with QuickPDF, though. The resulting file from the print job is blank. It does end up being the correct number of pages, but all pages are blank. The PDF appears to have no embedded text, so it's just purely scanned images saved as PDF.

I'm doing this in Delphi 2009. I will paste my code below. Does anyone know what could be the cause of this?

unit Converter.Handlers.Other.Postscript;

interface

  uses
    SysUtils, Variants,
    Converter.Printer, Converter.Settings, QuickPDF0721;

  procedure ToTiff(p_Printer: PrinterDriver; p_InputFile, p_OutputFile: String);

implementation

  // PDF Processing Class
  procedure ToTiff(p_Printer: PrinterDriver; p_InputFile, p_OutputFile: String);
  var
    g_LibraryObject : TQuickPDF0721;
    g_PrintOptions : Integer;
    fileSettings : TSettings;

  begin
    g_LibraryObject := TQuickPDF0721.Create;
    fileSettings := get_settings;

    try
      // License key
      g_LibraryObject.UnlockKey(' ... ');

      // Open and print
      g_PrintOptions := g_LibraryObject.PrintOptions(0, 1, ExtractFilename(p_InputFile));
      g_LibraryObject.LoadFromFile(p_InputFile);

      WriteLn(g_LibraryObject.PageCount);
      g_LibraryObject.PrintDocument('Universal Document Converter', 1, g_LibraryObject.PageCount, g_PrintOptions);
      g_LibraryObject.RemoveDocument(g_LibraryObject.GetDocumentID(2));
    finally
      g_LibraryObject.Free;
    end;
  end;

end.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 24 Aug 10 at 6:38AM
Hi Ryan!

Perhaps you can send me the file
and i'll try to print it with QP.
...and i'm sure i can print it.
PrintDocument is a very main function...
If it won't work here would be many more posts like yours ;-)

Cheers, Ingo

Back to Top
ryan.cole View Drop Down
Beginner
Beginner


Joined: 23 Aug 10
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote ryan.cole Quote  Post ReplyReply Direct Link To This Post Posted: 24 Aug 10 at 3:32PM
I was about to send to you the file, but was instructed by my co-workers that I probably shouldn't send it out. It's relatively sensitive data for us.
 
I've determined that the file does have JBIG2 compressed images in it, though. All pages are simply a large JBIG2 compressed image. That's why I think it's coming out entirely blank, but with the appropriate page count. (quickpdf doesnt support JBIG2, yet)
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 24 Aug 10 at 8:00PM
So we all hope/wait for 7.22 ;-)

Back to Top
ACX1 View Drop Down
Beginner
Beginner


Joined: 20 Sep 10
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote ACX1 Quote  Post ReplyReply Direct Link To This Post Posted: 20 Sep 10 at 1:35PM
Hello,
 
I have a similar problem. I downloaded QuickPDFLibrary version version 7.21 for evaluation.
 
What I need is a library for setting new values in already existing pdf files which contain form fields and then printing the files out.
The pdf files have been produced some time ago with Adobe Acrobat 5.0. There I inserted the form fields.
 
With QuickPDFLibrary 7.21  I was able to perform the value changes of the form fields. Also I could save the file. When viewing the changed pdf file in Adobe Acrobat 5.0 or Adobe Reader 9.0 everything seemed o.k.
The problem is, that if I print with QuickPDFLibrary the values of the form fields doesn't appear on the print-out.
 
I did several changes in the code, but I couldn't get the values on the print-out with QuickPDFLibrary 7.21.
 
The code looks like this:
 
                lngLoadFromFile = QPDF.LoadFromFile(strPathFilename1)
                lngSelectedDocument = QPDF.SelectedDocument
                                                                                
                Dim lngFindFormFieldByTitle As Long
                lngFindFormFieldByTitle = QPDF.FindFormFieldByTitle("FormatTeileNr")
               
                Call QPDF.SetFormFieldValue(lngFindFormFieldByTitle, strTeilenummer)
                Call QPDF.SetNeedAppearances(1)
 
                lngFormFieldPrintable = QPDF.SetFormFieldPrintable(lngFindFormFieldByTitle, 1)
                lngFormFieldVisible = QPDF.SetFormFieldVisible(lngFindFormFieldByTitle, 1)
                lngSaveToFile = QPDF.SaveToFile(strPathFilename3)
                lngRemoveDocument = QPDF.RemoveDocument(lngSelectedDocument)
               
                lngLoadFromFile = QPDF.LoadFromFile(strPathFilename3)
                lngSelectedDocument = QPDF.SelectedDocument
               
               
                lngPrintOptions = QPDF.PrintOptions(0, 0, strPathFilename2)
               
                Call QPDF.PrintDocument("Farbkopierer", 1, 1, lngPrintOptions)
 
Thank you for any help regarding this problem.
 
 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 20 Sep 10 at 6:44PM
Hi ACX1!

Use the advanced search functionality above with
"SetNeedAppearance" ... you'll find many samples.

Another thing: There can be differences if there are
fields with the same name more than once in your
pdf-form...

Cheers and welcome here,
Ingo

Back to Top
ACX1 View Drop Down
Beginner
Beginner


Joined: 20 Sep 10
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote ACX1 Quote  Post ReplyReply Direct Link To This Post Posted: 21 Sep 10 at 8:56AM
Hi Ingo,
 
thank you for the information. I have found the necessary information as you told me to do.
 
The point is to use "UpdateAppearanceStream".
 
QP.SetNeedAppearances(1); 
QP.SetFormFieldValueByTitle( FieldName, FieldValue );
nresult := QP.FindFormFieldByTitle(FieldName);
QP.UpdateAppearanceStream(nresult);
If nothing strange appears I will change to this library.
 
 
 
 
Back to Top
fc0107 View Drop Down
Beginner
Beginner


Joined: 19 Oct 10
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote fc0107 Quote  Post ReplyReply Direct Link To This Post Posted: 19 Oct 10 at 9:31AM
Hi there,

I'm evaluating the library, too, and just like for ACX1 I need to fill the form fields of some existing pdf's and print them.
Using SetNeedAppearance and UpdateAppearanceStream is almost fine, but not sufficient for me.
In fact, the values are printed, but the printed document just ignores the FormFieldComb and FormFieldMaxLen properties. I.e., I see the characters correctly spaced when I open or print the file with AcrobatReader or FoxitReader, but they are compressed when I print the file using QuickPDFLibrary.

Is there something I am missing?

Thanks a lot,
Francesco
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 9:27AM
Hi Francesco,

Can you post the code that you're using with FormFieldComb and FormFieldMaxLen?

Cheers,
- Rowan.
Back to Top
fc0107 View Drop Down
Beginner
Beginner


Joined: 19 Oct 10
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote fc0107 Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 10 at 9:43AM
Well,

the FormFieldComb and FormFieldMaxLen have been set in the PDF document using Acrobat, I tried to read them using GetFormFieldComb and FormFieldMaxLen, and the values I obtain are the ones I'm expecting.

This is the code I'm using to write the content of the field:

_pdfLibrary.SetFormFieldValue(10, "DONALD DUCK");
_pdfLibrary.UpdateAppearanceStream(10);

if I check the result of _pdfLibrary.GetFormFieldValue(10) I obtain 1, and the result of _pdfLibrary.GetFormFieldMaxLen(10) is 30.

Should I programmatically set these values or other properties?


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