Rank: Newbie Groups: Member
Joined: 5/27/2012 Posts: 3
|
I am trying to simply merge 2 pdf document. I believe this works for some pdf files, but the ones that I'm trying to merge give me the following execption back:
Here is the exeption:
Property 'W' can not be empty. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: Property 'W' can not be empty.
Source Error:
Line 34: Line 35: //Merge the files Line 36: PdfDocument doc = PdfDocument.Merge(doc1, doc2); Line 37: Line 38: string finalOutput = Server.MapPath("~/temp/") + "testout.pdf";
Source File: c:\Inetpub\wwwroot\DRC_EO_ReportGenerator\Default.aspx.cs Line: 36
Stack Trace:
[Exception: Property 'W' can not be empty.] EO.Pdf.Internal.ah.a(String A_0, Boolean A_1) +345 EO.Pdf.Internal.a..ctor(ah A_0) +422 EO.Pdf.Internal.b0..ctor(gn A_0) +956 EO.Pdf.Internal.gn.d() +72 EO.Pdf.PdfDocument.Merge(PdfDocument[] docs) +1089 _Default.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\DRC_EO_ReportGenerator\Default.aspx.cs:36 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3618
Here is my code:
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string rpt1 = Server.MapPath("~/temp/") + "testpdf.pdf"; string rpt2 = Server.MapPath("~/temp/") + "testpdf2.pdf"; PdfDocument doc1 = new PdfDocument(rpt1); PdfDocument doc2 = new PdfDocument(rpt2);
//Merge the files PdfDocument doc = PdfDocument.Merge(doc1, doc2);
string finalOutput = Server.MapPath("~/temp/") + "testout.pdf";
//Save the result doc.Save(finalOutput); } }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Please try to update to the latest build. I believe this was an issue that's already fixed.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 5/27/2012 Posts: 3
|
Awesome, I downloaded the latest build and it's working now. Thanks for the quick response.
|