1

我有一个关于使用 ABCPDF.dll 构建动态 PDF 文档的问题。

我了解基础知识并有一个可靠的解决方案。我有一个新要求,我需要将页面动态添加到 PDF 文档。

具体来说,我的 PDF 文档是一个两个寻呼机。第二页需要是一个单独的 PDF 文件,其中一个或多个页面将由用户添加。

我查看了文档和代码示例并查看了 AddPage() 方法。这似乎并不符合我的需要。

这是一个代码示例:

         void Page_Load( object sender, System.EventArgs e )
    {
        int theID = 0;
        string theText = "This PDF file is generated by WebSupergoo ABCpdf.NET on the fly";
        Doc theDoc = new Doc();

        theDoc.Width = 4;
        theDoc.FontSize = 32;
        theDoc.Rect.Inset( 20, 20 );
        theDoc.FrameRect();
        theID = theDoc.AddHtml( theText );

        while ( theDoc.GetInfo( theID, "Truncated" ) == "1" )
        {
            theDoc.Page = theDoc.AddPage();
            theDoc.FrameRect();
            theID = theDoc.AddHtml( "", theID );
        }
        theDoc.Save( Server.MapPath( "textflow.pdf" ) );
        theDoc.Clear();

        Response.Write( "PDF file written<br>" );
        Response.Write( "<a href=\"textflow.pdf\">View PDF File</a>" );
    }

有人可以建议一种使用 ABC PDF 将页面添加到 PDF 文档的方法吗?上面的示例可能正在使用 AddPage,但我需要指定另一个 PDF 文件以动态添加。PDF 文件名可以更改。

谢谢你。

谢谢你。

4

2 回答 2

0

我相信 abcpdf 允许您将 PDF 文档合并到另一个文档的末尾。看这里

于 2012-02-06T20:52:14.043 回答
0

如果我理解您的问题,您想将 PDF 添加到不同 PDF 的末尾。如果那是您所需要的,那么Append 方法似乎就是您所需要的。

于 2012-02-06T20:52:41.587 回答