I'm trying to render an HTML within a predefined PDF-template (e.g. within a frame.) The template/frame should reach the edges. But the HTML shouldn't do that. So I need some kind of margin for the HTML only. Here is my code so far:
var doc = new Doc();
doc.MediaBox.String = "A4";
doc.Rect.String = doc.MediaBox.String;
var id = doc.AddImageUrl(url.ToString());
doc.AddImageDoc("template.pdf", 1, doc.MediaBox);
while (doc.Chainable(id))
{
doc.Page = doc.AddPage();
id = doc.AddImageToChain(id);
doc.AddImageDoc("template.pdf", 1, doc.MediaBox);
}
for (var i = 1; i <= doc.PageCount; i++)
{
doc.PageNumber = i;
doc.Flatten();
}
I see, that there is a possibility to pass a Rect to #AddImageDoc
. But I don't have this option for #AddImageUrl
.