我使用 abcpdf 从 html 字符串创建 pdf。以下代码段显示了我的操作方式:
var pdfDocument = new Doc();
pdfDocument.Page = pdfDocument.AddPage();
pdfDocument.Font = pdfDocument.AddFont("Times-Roman");
pdfDocument.FontSize = 12;
var documentId = pdfDocument.AddImageHtml(innerHtml);
var counter = 0;
while (true)
{
    counter++;
    if (!pdfDocument.Chainable(documentId))
    {
        break;
    }
    pdfDocument.Page = pdfDocument.AddPage();
    // how to add a inset of 20, 0 on every page after the second? The following 2lines don't affect the pdf pages
    if (counter >= 3)
        pdfDocument.Rect.Inset(20, 0);                
    documentId = pdfDocument.AddImageToChain(documentId);
}
在 AddPage 之后,我想为 pagenumber > 2 的每个页面添加一个新的插图
提前致谢