Blank pages when converting to PDF with TuesPechkin

2.6k Views Asked by At

I'd like to convert several different web pages into one PDF document. I found Pechkin / TuesPechkin, which has been a wonderful discovery, but I am running into one problem: only the last Object gets converted, and all the other PDF pages are blank. What could be causing this problem?

var document = new HtmlToPdfDocument
{
    GlobalSettings =
    {
        Margins =
        {
            All = 1.375,
            Unit = Unit.Centimeters
        }
    }
};

// Each "page" variable contains one HTML page
foreach (var page in pages)
    document.Objects.Add(new ObjectSettings { HtmlText = page.Html });

// Create converter
var converter = Factory.Create();

// Convert!
var result = converter.Convert(document);

// Save
File.WriteAllBytes(path, result);
1

There are 1 best solutions below

0
On BEST ANSWER

Turns out that this is a confirmed bug. https://github.com/tuespetre/TuesPechkin/issues/23

I ended up solving the issue by generating one page at a time and merging the pages with iTextSharp.