PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

HTML to PDF problem
http://forum.pdfsharp.com/viewtopic.php?f=2&t=3829
Page 1 of 1

Author:  FanPilot [ Tue Aug 21, 2018 7:13 pm ]
Post subject:  HTML to PDF problem

Hi,

I have a docx file in landscape format that I am populating as a mail merge (using the OpenXML SDK). I am struggling to find a decent (free) docx to pdf convertor, so I am using the OpenXML Power tools to convert it to HTML, as I know that PDFSharp can convert HTML to PDF.

The document is predominantly tables. The HTML is generated fine (mostly fine... it has borders on a table that it shouldn't have, but that is not a PDFSharp issue).

When I come to create a PDF, I have the code...

Code:
                PdfGenerateConfig conf = new PdfGenerateConfig();
                conf.PageOrientation = PageOrientation.Landscape;
                conf.PageSize = PageSize.A4;
                conf.SetMargins(32);
               
                PdfDocument pdf = PdfGenerator.GeneratePdf(HtmlString, conf);

                pdf.Save(Filename);


but my output PDF is chopping off the right side of the tables, which works out to be about 1/3rd of the document.

Am I missing something here?

Thank you.

Author:  TH-Soft [ Tue Aug 21, 2018 9:21 pm ]
Post subject:  Re: HTML to PDF problem

Hi!
FanPilot wrote:
Am I missing something here?
You have come to the wrong forum. PDFsharp cannot convert HTML to PDF. You are using a third-party tool that uses PDFsharp internally.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/