hi, is anyone using ben fosters migradoc extensions?
https://github.com/benfoster/MigraDoc.Extensionsi was searching for something to convert html and this works a treat! however, i've got one issue...
in the example provided, he uses a section:
Code:
var doc = new Document();
var section = doc.AddSection();
var html = File.ReadAllText("example.html");
section.AddHtml(html);
var renderer = new PdfDocumentRenderer();
renderer.Document = doc;
renderer.RenderDocument();
renderer.Save(outputName);
however, i've been using a section with paragraphs so i can position the text in my template:
Code:
var gfx = XGraphics.FromPdfPage(page);
gfx.MUH = PdfFontEncoding.Unicode;
gfx.MFEH = PdfFontEmbedding.Default;
var doc = new Document();
var sec = doc.AddSection();
var profile = sec.AddParagraph();
var html = File.ReadAllText("example.html");
profile.AddText(html );
var docRenderer = new DocumentRenderer(doc);
docRenderer.PrepareDocument();
docRenderer.RenderObject(gfx, XUnit.FromCentimeter(21.2), XUnit.FromCentimeter(7.5), XUnit.FromCentimeter(6.6), profile);
try as i might, i cant figure out a way to create a section as his example and then position it correctly...
does anyone have any pointers? this feels like i'm 99% of the way there and i'm just missing the last bit...
any suggestions would be tops!
cheers,
jake