Print Page | Close Window

Blank preview

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=831
Printed Date: 10 May 24 at 2:05AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Blank preview
Posted By: Autodidact
Subject: Blank preview
Date Posted: 10 Dec 07 at 6:51AM
I'm testing critical functionality of the ActiveX library (5.22) before turning down or going for making a web-application. The application is to make users select a template, change some text and see a preview before approving the changes to be saved in a new file, ready for printing..

Initially I tested the SavePagePreview function that seem to work as expected, but in the second round of test where I'm using a premade PDF and altering the value of a form field - the render is totally white/blank.
After further testing I'm able to have it render added/drawn text, but the rest of the content already in the file (text, image and form field) are not rendered.

This is unfortunately a showstopper, so I'm in need for some help/advice..

BTW; I have tried the RenderDocumentToFile function as well, but that function has a serious limitation as it seem to ignore / not use the setting of temp path/file. It seems to generate a temporary file in the system32 folder - something the webhost never will allow to give rights to..



Replies:
Posted By: marian_pascalau
Date Posted: 14 Dec 07 at 5:57AM

Whe using QuickPDF with Web or with a normal Exe there is no difference other then "hosting" environmen.

Can you please provide a sample program (in form of source code), written in C++, C#, VB, VBS or Delphi and send it to
    support(at)quickpdf.org.
 
I will check your problem when I will have some free time.
 
Regards :-)


Posted By: Autodidact
Date Posted: 17 Dec 07 at 6:58AM
I intended to clean up the ASP test-code and make some structured notes before gracefully taking your generous offer Marian. As I did, I managed to have the RenderPreviewToFile work as intended without it complaining about the lack of access-rights to the system32 folder. I also checked the access-rights to the folder, and it was not left escalated from my previous testing.

Happy as I was, I scrapped all ASP.NET testing (although I expect some challenges there too later on), and ventured on to see if I could manage to have it render the content of the form-fields as well, and I did - using the FlattenFormField function.

The code did not change and flatten all fields (function returned 0), but for some weird reason, moving the code lines (order of fields being changed - they are actually changed by name. not index) it did change, flatten and render all fields.. 8o)

Now I need to check the current test-code on another computer and then request my web host to install/register the ActiveX so I can test it live.




Posted By: Autodidact
Date Posted: 17 Dec 07 at 7:14AM
Yepp, there is something weird with the order the form fields are changed and flattened! Did a test with the following code;

Dim X
For X = 1 To 3
     RetVal = QP1.SetFormFieldValue( X, Now() )
     Response.Write( RetVal )

     RetVal = QP1.FlattenFormField( X )
     Response.Write( RetVal & "<br>")     
Next


gives the output:

11
11
00 (not changed, or flattened - thus not rendered)

While ..

Dim X
For X = 3 To 1 step -1
     RetVal = QP1.SetFormFieldValue( X, Now() )
     Response.Write( RetVal )

     RetVal = QP1.FlattenFormField( X )
     Response.Write( RetVal & "<br>")     
Next


Works as expected. Confused


Posted By: chicks
Date Posted: 17 Dec 07 at 6:39PM
It's not weird, but expected behavior.

When you flatten a field, it no longer exists in the PDF document. Therefore, if you flatten what had been referred to as index #1, the field that was previously #2 is now #1, etc. The correct methods are to flatten from last to first, or to always flatten field #1 if going from first to last.


Posted By: Autodidact
Date Posted: 18 Dec 07 at 2:25AM
Now that you mention it, that makes perfect sense - to me as well. I wish such little "easy to miss" obviousness could be mention a little clearer in the documentation.. The line "The form field will then be removed from the document.." did not quite trigger the thought of the index also being changed.

Thank you!



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