WebSupergoo ABCPDF自动生成pdf - 即时添加页面?

时间:2012-02-06 20:36:13

标签: c# abcpdf

我有一个关于使用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文件名可以更改。

谢谢。

谢谢。

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

如果我理解您的问题,您希望在不同PDF的末尾添加PDF。如果这就是您所需要的,看起来Append method就是您所需要的。