Using the HiQPDF [link=
http://www.hiqpdf.com]html to pdf[/link] conversion engine you can easily design a document in HTML with CSS3, JavaScript, SVG or Canvas and then convert it to PDF preserving the exact content and style.
HiQPdf library is a powerful and precise .NET library that you can call from a C++ Native Windows Application.
First you should register the HiQPdf classes for COM clients and produce a type library file by executing the following command in an Administrator command prompt:
regasm HiQPdf.dll /tlb:HiQPdf.tlb
The HiQPdf.tlb will be included in the C++ application code to offer the prototypes for HiQPdf classes and methods. The compiler will produce a C++ header file named HiQPdf.tlh from the TLB file, containing the HiQPdf library types and methods prototypes.
The HiQPdf.dll and HiQPdf.dep files must be copied near the application executable or otherwise you have to install the HiQPdf.dll in GAC to make it available for COM infrastructure. The C++ code of a simple console application which converts an URL and saves the resulted PDF document to a file on disk looks like below:
#include#include#import "HiQPdf.tlb" raw_interfaces_only
using namespace HiQPdf;
int main()
{
CoInitialize(0);
{
// create the HTML to PDF converter
_HtmlToPdfPtr htmlToPdfConverter(__uuidof(HtmlToPdf));
// get a reference to the PDF document control object from converter
_PdfDocumentControl * pdfDocumentControl;
htmlToPdfConverter->get_Document(&pdfDocumentControl);
// set PDF page orientation
pdfDocumentControl->put_PageOrientation(PdfPageOrientation_Portrait);
// set PDF page margins
_PdfMargins* pdfMargins;
pdfDocumentControl->get_Margins(&pdfMargins);
pdfMargins->put_Left(10);
pdfMargins->put_Right(10);
pdfMargins->put_Top(10);
pdfMargins->put_Bottom(10);
// create the URL to convert and output PDF file name strings
BSTR urlToConvert = SysAllocString(L"enter here theURL address");
BSTR outPdfFile = SysAllocString(L"out.pdf");
// call the converter to convert the HTML document to a PDF file
htmlToPdfConverter->ConvertUrlToFile(urlToConvert, outPdfFile);
// free the allocated strings
SysFreeString(urlToConvert);
SysFreeString(outPdfFile);
}
CoUninitialize();
return 0;
}
The HTML to PDF, HTML to SVG and HTML to Image converters included in the HiQPdf library for .NET can be used to create high quality PDF documents, SVG vector images and transparent PNG images.
You can download the [link=
http://www.hiqpdf.com]html to pdf[/link] demo applications for HiQPDF Library with source code in C# and VB
Comments
public void ConvertPdftoHtml();
{
PDFInputFile = (@C:/1.pdf);
PDFPageNumber = "1";
HTMLOutputFile = OutputFormat.html;
}
PDF.Save("OutputFormat.html", SaveFormat.Html);
public void ConvertPdftoHtml();
{
PDFInputFile = (@C:/1.pdf);
PDFPageNumber = "1";
HTMLOutputFile = OutputFormat.html;
}
PDF.Save("OutputFormat.html", SaveFormat.Html);
I don't know whether there are any differences between the tools you are using and this DSK introducted by my friend and it is said that this PDF converter is very [link=http://www.yiigo.com/net-document-image-plugin/pdf-plugin/]simple and fast in its processing way[/link].
I'm a newbbie here.
Many thanks for your help.