We're using ABCPDF.Net 8 to generate PDF documents for users. The HTML source is loaded directly as a string and images are defined in the HTML with the full path. Example:
<img id="img1" src="file://D:/trakit/images/cl_logo.gif" alt="" />
This works beautifully and we have about 200 users generating PDFs with no problem.
The problem is that a few handful of users are not getting the images in the PDF. The images are replaced by the image placeholder that is shown by IE when an image is not found.
This happens consistently for some users only. I cannot figure out what is wrong as the PDF is generated server-side and should not have anything to do with the user's browser settings. I agree that the page/code is running under the user's permissions (we use windows authentication), but why should this affect PDF image generation? Below is the code snippet to generate the PDF:
PDFDoc.Rect.Inset(20, 20)
PDFDoc.Page = PDFDoc.AddPage()
li_PDFID = PDFDoc.AddImageHtml(as_HTML, True, 1050, True)
While PDFDoc.Chainable(li_PDFID)
PDFDoc.Page = PDFDoc.AddPage()
li_PDFID = PDFDoc.AddImageToChain(li_PDFID)
End While
For li_Loop = 1 To PDFDoc.PageCount
PDFDoc.PageNumber = li_Loop
PDFDoc.Flatten()
Next
Return PDFDoc.GetData()
Any help will be greatly appreciated.
Thanks.
Update: Just found that if the user users another browser (such as Firefox), the images then generate fine. This narrows down the problem to IE 7/8 on the user's computer. Any suggestions?
Okay. The issue was finally found and has nothing to do with ABCPDF.
Seems part of the HTML source was coming from the user's browser - obtained using javascript function innerhtml() on IE. And I just found out that IE has a big problem with innerhtml()
All sorted now.