Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support


All forums · Statistics · Search ·

Two Pilots forum / For software developers / Image display and adding headers and footers
Author Message
Gowsalya
Member
# Posted: 1 Dec 2004 14:56


Hello,
We are evaluating HTML2PDFAddOn. When the html text has an img tag, the image is not displayed correct on the PDF document.
We would also like to add headers and footers to PDF document (the body text will be HTML only). I have copied the code below.

long Size;
Array PDFImage;
PDFCreatorPilot2.piPDFDocument PDF = new PDFCreatorPilot2.piPDFDocument();
PDF.StartEngine("demo@demo", "demo");
PDF.GenerateInMemoryFile = true;
PDF.BeginDoc();

StringBuilder sb = new StringBuilder();
sb.Append("<html><body></body></html>");

HTML2PDF HTML = new HTML2PDF();
HTML.StartHTMLEngine("","");
HTML.ConnectToPDFLibrary(PDF);
HTML.LoadFromString(sb.ToString(), "");
HTML.ConvertAll();
HTML.DisconnectFromPDFLibrary();
PDF.EndDoc();

Size = PDF.MemoryFileSize;
byte[] PDFBuffer = new byte[((int)Size)];
PDFImage = (Array)PDF.BinaryImage;
Array.Copy(PDFImage, PDFBuffer, Size);
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("Content-Disposition", "inline;filename=form.pdf");
Response.BinaryWrite(PDFBuffer);
Response.End();

Thanks,
Gowsalya

Eugene
Member
# Posted: 3 Dec 2004 09:43


Please check if img tag link is to local file. Currently HTML2PDF Add-on is not able to handle remote images so image is not displayed if link is to
remote image file.

Header and footer are not used in HTML2PDF Add-on currently. However you can form HTML code and make some kind of header and footer and then convert HTML into PDF using PDF Creator Pilot and HTML2PDF add-on.

Anonymous
# Posted: 15 Jan 2005 20:18


When will HTML2PDF be able to handle remote images? Without this functionality, how can I convert html into pdf on the server dynamically when the html files have remote images?

admin
Admin
# Posted: 18 Jan 2005 15:01


The HTML2PDF Add-on version with remote images support will be available on next week.

 

 

Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.013

 

Page top