0

I'm using the following code to generate a PDF using ExpertPDF v7.0

 pdfConverter.PdfDocumentOptions.PdfPageSize = ExpertPdf.HtmlToPdf.PdfPageSize.Letter
 pdfConverter.PdfDocumentOptions.PdfCompressionLevel = ExpertPdf.HtmlToPdf.PdfCompressionLevel.Normal
 pdfConverter.PdfDocumentOptions.PdfPageOrientation = ExpertPdf.HtmlToPdf.PDFPageOrientation.Portrait

 ' set if header and footer are shown in the PDF - optional - default is false 
 pdfConverter.PdfDocumentOptions.ShowHeader = False
 pdfConverter.PdfDocumentOptions.ShowFooter = False
 ' set to generate a pdf with selectable text or a pdf with embedded image - optional - default is true

 pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = True

 ' set if the HTML content is resized if necessary to fit the PDF page width - optional - default is true
 pdfConverter.PdfDocumentOptions.FitWidth = True
 pdfConverter.PdfDocumentOptions.StretchToFit = True

 'pdfConverter.PdfDocumentOptions.AutoSizePdfPage = True
 ' set the embedded fonts option - optional - default is false
 ' pdfConverter.PdfDocumentOptions.EmbedFonts = True
 ' set the live HTTP links option - optional - default is true
 'pdfConverter.PdfDocumentOptions.LiveUrlsEnabled = True
 pdfConverter.PdfDocumentOptions.LeftMargin = 36
 pdfConverter.PdfDocumentOptions.RightMargin = 36
 pdfConverter.PdfDocumentOptions.TopMargin = 36
 pdfConverter.PdfDocumentOptions.BottomMargin = 36
 pdfConverter.PageWidth = 756
 pdfConverter.AvoidImageBreak = True

And then the actual call to the PDF reader is as follows:

 objFile = pdfConverter.GetPdfDocumentObjectFromHtmlString(htmlString, baseURL)

I'm using this tool to generate batches of document with receipts attached as jpegs. Unfortunately, when I get a batch with a lot of receipts the images stop appearing. For a small number they simply stop appearing randomly (the image is replaced by the classic small red X icon), and with larger numbers of images all of the images fail to load.

This seems directly related to the number of images in the document (as subsets of large batches and other small jobs work just fine). I've also replicated this by simply adding a large number of images to our expense report (where the receipts are originally uploaded).

Has anyone experienced this issue or have a solution?

wax eagle
  • 541
  • 11
  • 27
  • I've posed the same question to ExpertPDF's email support line and if they resolve it before a solution is reached here I'll post their resolution. – wax eagle Jan 21 '14 at 20:49

1 Answers1

1

Try to set pdfConverter.ConversionDelay to a few seconds to allow your pages to load. I am using ExpertPdf v9 with this property and it works fine.

charpdevel0p3r
  • 346
  • 2
  • 2