WebSupergoo ABCPDF自动生成pdf-动态添加页面

本文关键字:添加 动态 pdf- ABCPDF 自动生成 WebSupergoo | 更新日期: 2023-09-27 18:22:39

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

谢谢。

谢谢。

WebSupergoo ABCPDF自动生成pdf-动态添加页面

如果我理解你的问题,你想在另一个PDF的末尾添加一个PDF。如果这就是您所需要的,那么Append方法似乎就是您所需的。

我相信abcpdf允许您将一个PDF文档合并到另一个文档的末尾。请参阅此处