GdPictureDocumentConverter HTML
Posted: Wed Mar 17, 2021 9:18 am
Hi,
i want to convert a simple html file to pdf. I used the following example code.
My html file:
The programm creates every time a 0 bytes pdf file. I got no exceptions. The license is valid, other gdpicture code works fine (except word to pdf)
I used GdPicture.NET Document Imaging SDK Ultimate V14.1.0.107
any suggestions?
Best Regards Oliver
i want to convert a simple html file to pdf. I used the following example code.
Code: Select all
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
// Set the text and document properties to be used for the resulting file.
gdpictureDocumentConverter.HtmlPageHeight = 842; // A3 page size
gdpictureDocumentConverter.HtmlPageWidth = 1191; // A3 page size
gdpictureDocumentConverter.HtmlPageMarginTop = 10;
gdpictureDocumentConverter.HtmlPageMarginBottom = 10;
gdpictureDocumentConverter.HtmlPageMarginLeft = 10;
gdpictureDocumentConverter.HtmlPageMarginRight = 10;
using (Stream inputStream = File.Open("input.html", System.IO.FileMode.Open))
{
using (Stream outputStream = File.Create("output.pdf"))
{
gdpictureDocumentConverter.ConvertToPDF(inputStream, GdPicture14.DocumentFormat.DocumentFormatHTML, outputStream, PdfConformance.PDF1_5);
}
}
}
Code: Select all
<html>
<h1>Hello World</h1>
test
</html>
I used GdPicture.NET Document Imaging SDK Ultimate V14.1.0.107
any suggestions?
Best Regards Oliver