Quantcast
Viewing all articles
Browse latest Browse all 3636

Check if PDF is complete

Im creating a PDF from crystal reports and then open it with adobe reader straight after.

However, sometimes I think adobe reader tries to open the file before it is fully created. (The pdf file exists but maybe still not complete ??)

Here is my code:

rep.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Utilities.Paths.pathToPDFs + fileNamePreFix + dt + ".pdf");

            

 

Open("\"" + Utilities.Paths.pathToPDFs, fileNamePreFix + dt + ".pdf" + "\"", Utilities.Paths.pathToAdobeReader);

System.Diagnostics.Process.Start(Utilities.Paths.pathToAdobeReader, "\"" + Utilities.Paths.pathToPDFs + fileNamePreFix + dt + ".pdf" + "\"");

         

Could it be that the ExportToDisk is returning early before the PDF file has been fully created ?

 

This is the error message I am getting:

Image may be NSFW.
Clik here to view.
adobeearly.png

 

Once I click OK, then then Adobe reader displays the report.

 

J


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>