You are not logged in.
Pages: 1
Hello i've an Html File with some tables on it .
please how can i convert this html file into a PDF file using SynPdf library .
this's what i want as a pseudo code :
Procedure ConvertHtmlToPdf(AsourceHtMLFile,ATargetPDFFile:String);
var
lPdf : TPdfDocument;
lPage : TPdfPage;
begin
lPdf := TPdfDocument.Create;
try
lPdf.LoadFromFile(AsourceHtMLFile);//<--- this procedure doesn't exist just to show you what i want
//**
//**
lPdf.SaveToFile(ATargetPDFFile);
finally
lPdf.Free;
end;
end;
and here's an Html file sample :
http://img17.imageshack.us/img17/8859/htmlsample.png
Please is This possible ?.
many thanks , Randy
Offline
The SynPDF library does not have any HTML renderer built-in.
You have to use an HTML renderer, able to convert the HTML content into metafile content.
We have tested it with THtmlViewer, and it works very well.
See http://blog.synopse.info/post/2010/07/1 … -free-tool
But we tested it with Delphi < 2009, i.e. non Unicode Delphi: this THtmlViewer component was not compatible with Unicode at this time.
The SynPDF library is perfectly Unicode ready, on its side.
Offline
Hi ab, the latest version THtmlViewer (version 11) already support unicode, using TntUnicodeControls and also support WideStrings
maybe you could update htm2pdf-free. It'll be useful tools
https://code.google.com/p/thtmlviewer/
Last edited by ebz (2013-03-31 10:37:04)
Offline
So you can for sure use THtmlViewer to render the content and export it as PDF.
You just need to adapt the code supplied in http://blog.synopse.info/post/2010/07/1 … -free-tool
Offline
Pages: 1