Print Page | Close Window

My printed pages are blank!

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=395
Printed Date: 29 Mar 24 at 5:30AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: My printed pages are blank!
Posted By: Jim Sullivan
Subject: My printed pages are blank!
Date Posted: 17 Apr 06 at 4:27PM

OK, for the first time I'm trying to use the PrintDocument function.  Here's my code:

QP.SaveToFile "c:\temp\pages.pdf"

'Call ShellExecute(apiGetWindow(apiGetDesktopWindow(), GW_CHILD), "Print", "c:\temp\pages.pdf", vbNullString, CurrentProject.Path, SW_HIDE)
QP.PrintDocument("Microsoft Office Document Image Writer", 1, 2, QP.PrintOptions(0, 0, "Pages"))

The content exists in the file pages.pdf.  Also, when I then use the commented out line to print the pages.pdf file it works fine.  When I use the PrintDocument command, though, I get two blank pages.

Is there something else I need to do?

 




Replies:
Posted By: Ingo
Date Posted: 18 Apr 06 at 1:56AM
Hi!
Perhaps it's the missing "LoadFromFile" before "PrintDocument"...?
Best regards,
Ingo


Posted By: Jim Sullivan
Date Posted: 18 Apr 06 at 10:00AM

I am generating the file in memory completely before I execute my SaveToFile command.  Well, actually I'm opening up and existing form, filling out the fields, adding some extra text, and then saving.  But the saved file looks fine, so that means that I have the two-page form in the object, right?

 



Posted By: swb1
Date Posted: 18 Apr 06 at 10:15AM

That sounds correct.

Have you tried RenderDocumentToFile? This function employs a number of the same routines as PrintDocument.

You may also wish to try re-loading your document after the save.

 

Regards

sb

 

 

 



Posted By: Jim Sullivan
Date Posted: 18 Apr 06 at 10:47AM

It turns out that way earlier in the process I had encrypted the document so that it could be opened but not changed.  When I commented out that line then the printing worked.

 



Posted By: Jim Sullivan
Date Posted: 18 Apr 06 at 11:06AM

OK, new problem.  After not encrypting the file I do get a printout.  However, all data in my form fields is gone.

The same thing happens when I use FlattenFormField without even printing.  When I use FlattenFormField and then save the file to the hard drive, the information disappears.

 



Posted By: JanN
Date Posted: 18 Apr 06 at 12:44PM
In such cases I like to recommend the functions SetNeedAppearances and UpdateAppearanceStream.

Hope this helps.


Posted By: Jim Sullivan
Date Posted: 18 Apr 06 at 1:39PM

When would you suggest doing this?  I tried it all over and it didn't seem to help.  Here's my current code:

qp.LoadFromFile CurrentProject.Path & "\fields.pdf"
qp.SetNeedAppearances 1

Do Until qp.FormFieldCount = 0
    qp.UpdateAppearanceStream 1
    qp.FlattenFormField 1
Loop
qp.SaveToFile CurrentProject.Path & "\test.pdf"

The file test.pdf contains no information from any fields on it.



Posted By: JanN
Date Posted: 19 Apr 06 at 3:03AM
To be honest: I do not really know. It's just that these functions were helpful in some cases that had to do with form fields.



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