Intermittent Empty PDF files

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Intermittent Empty PDF files

Postby dCipher » Thu Dec 14, 2017 2:24 am

Hi

We have an application on a Window 2012 Server where clients access the application via Remote Desktop Top. The application uses VpeCtrl71.ocx to print reports and generate PDF files. This application can also email pdf reports to customers. However, we experience intermittent problems where the attached Pdf file is empty yet if we go and look at the report using VPEView the report contains data but the generated pdf is empty. We cannot figure what causes this issue. Most of the time the pdf attachements are complete but then there are times when the pdf is empty. The EnableMultiThreading is set to true. So I am looking for suggesting as to the possible causes.

Thanks,
Simon
dCipher
 
Posts: 18
Joined: Wed Apr 27, 2011 7:41 pm

Re: Intermittent Empty PDF files

Postby IDEAL Software Support » Thu Dec 14, 2017 9:03 am

Is the generated PDF file of size zero bytes, or does it contain some bytes? In the latter case, e-mail us such a file. Maybe the content gives a hint what is going on.

How exactly do you create the PDF file? Does the user click onto the e-mail button or do you create the e-mail by code?
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: Intermittent Empty PDF files

Postby dCipher » Thu Dec 14, 2017 3:45 pm

Hi

I use the following code from Visual FoxPro v9 to create the pdf files and then I have other code that creates the email and attaches the pdf file.

Code: Select all
Lparameters tcPFile,tlNoPrompt,tlForceMail
Local lcFile

This.cTitle=ForceExt(This.cTitle+"_"+goApp.cProcessID,"pdf")
If goApp.oPrintParam.eMail.Or.goApp.oPrintParam.SMTP.Or.goApp.oPrintParam.FTP.Or.tlForceMail.Or.PEMStatus(goApp.oPrintParam,"lUnattended",5)
   lcFile = Addbs(Sys(5)+Sys(2003))+"Rpt\"+This.cTitle
Else
   lcFile = Putfile("File Name:",This.cTitle,"pdf")
EndIf
If Empty(lcFile).Or.!This.WriteDoc(ForceExt(lcFile,"pdf"))
   This.Parent.cErrorMsg = "PDF File was not created!"
EndIf



I will ask the customer to send me one of these empty pdf files and then forward it you.

Thanks,
Simon
dCipher
 
Posts: 18
Joined: Wed Apr 27, 2011 7:41 pm

Re: Intermittent Empty PDF files

Postby IDEAL Software Support » Wed Dec 20, 2017 10:06 am

We analysed the file structure and it is well formed PDF. We also examined the file with Adobe Preflight and it did not report any errors. This leads to the conclusion, that VPE did not crash or malfunction in any way while creating the PDF file.

There is only one reason, why the file is empty: Your code exports an empty file. Maybe you have marked all objects as non-printable (property VPE.Printable = false)?
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: Intermittent Empty PDF files

Postby dCipher » Wed Dec 20, 2017 3:24 pm

Hi

To my knowledge I do not think I have every used this property but I will ensure that it is true before creating a pdf file.

Thanks,
Simon
dCipher
 
Posts: 18
Joined: Wed Apr 27, 2011 7:41 pm

Re: Intermittent Empty PDF files

Postby IDEAL Software Support » Wed Dec 20, 2017 5:50 pm

Each PDF has a header, a body and a footer. Without footer, it is not a valid PDF. The body contains the visual content. If the footer is present - which is the case - VPE has gone through the process of writing all objects (like text, images, etc.) to the PDF. So the only other explanation is that the VPE document is empty.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: Intermittent Empty PDF files

Postby dCipher » Fri Jun 08, 2018 3:40 pm

Hi

Just as a followup I turned off the PDF compression feature in VPE several months ago and I have not heard of any customers receiving an empty pdf files since that time. The application sends about 12k - 15k pdf files per month and so far all of them seem to be complete.

Simon
dCipher
 
Posts: 18
Joined: Wed Apr 27, 2011 7:41 pm

Re: Intermittent Empty PDF files

Postby IDEAL Software Support » Sat Jun 09, 2018 10:50 am

It is hard to believe that there should be a bug in our compression code. The reason is, that you told us one and the same document can be written to PDF successfully at one point in time, and at another point in time it is corrupted. Is it really 100% the same document?

Can you send us a VPE document file - suffix ".vpe", created using WriteDoc() - which causes a corrupted PDF output, so the problem is reproducible?
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: Intermittent Empty PDF files

Postby dCipher » Tue Feb 05, 2019 10:55 pm

Hi

I apologize for the long delay but I am still investigating this issue which only appears to show up when sending the pdf reports via email. So I have been investigating whether Windows CDO component might be at fault. I recently discovered some conditions that occasionally corrupt other attachment types (i.e. CR+LF is changed to just CR) and so I will begin some testing with a different email tool to see if that fixes this issue.

Simon
dCipher
 
Posts: 18
Joined: Wed Apr 27, 2011 7:41 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 7 guests

cron