Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Apr 25, 2016 9:08 am

Hello,
For one of our project requirements, We are merging files using PDF byte arrays. While performing this operation, we came across one exception by which file is not getting merge.
We are working on sensitive client data, so we are not able to share this file with you.

Please find the exception detail for your reference.

at Spire.Pdf.Widget.PdfChoiceWidgetFieldWidget.get_SelectedItem()
at Spire.Pdf.Widget.PdfComboBoxWidgetFieldWidget.GetFontHeight(PdfFontFamily family)
at Spire.Pdf.Widget.PdfStyledFieldWidget.ᜀ(String A_0, Boolean& A_1)
at Spire.Pdf.Widget.PdfStyledFieldWidget.get_Font()
at Spire.Pdf.Widget.PdfStyledFieldWidget.GraphicsProperties..ctor(PdfStyledFieldWidget fieldWidget)
at Spire.Pdf.Widget.PdfStyledFieldWidget.GetGraphicsProperties(GraphicsProperties& graphicsProperties, PdfFieldWidgetItem widgetItem)
at Spire.Pdf.Widget.PdfComboBoxWidgetFieldWidget.ᜀ(PdfCanvas A_0, PdfFieldWidgetItem A_1)
at Spire.Pdf.Widget.PdfComboBoxWidgetFieldWidget.ᜀ(spr  A_0, PdfFieldWidgetItem A_1)
at Spire.Pdf.Widget.PdfComboBoxWidgetFieldWidget.BeginSave()
at Spire.Pdf.Fields.PdfForm.ᜀ()
at Spire.Pdf.Fields.PdfForm.Dictionary_BeginSave(Object sender, sprᤞ ars)
at spr .ᜀ(sprᤞ A_0)
at spr .ᜀ(sprᢅ A_0, Boolean A_1)
at spr .ᜀ(sprᢅ A_0)
at sprᴜ.ᜀ(sprᢺ A_0, sprᯆ A_1)
at spr᪮.ᜁ(sprᢺ A_0, sprᯆ A_1, sprម A_2)
at spr᪮.ᜀ(sprᢺ A_0, sprម A_1)
at spr᪮.ᜄ(sprម A_0)
at spr᪮.ᜅ(sprម A_0)
at Spire.Pdf.PdfNewDocument.Save(Stream stream)
at Spire.Pdf.PdfDocumentBase.Save(String filename)
at Spire.Pdf.PdfDocument.SaveToFile(String filename)
at MergeFilesInPDFApp.Program.MergePdfBytes(String strFilePath, Dictionary`2 sourceFiles)

Can you please let us know why this error occurred (root cause of this error) as we have checked this PDF file and it is opening without any error?
We have tried several other methods, but same error occurred.

Code Base
public static void MergePdfBytes(string strFilePath, Dictionary<string, byte[]> sourceFiles)
{
FileInfo licenseFile = null;
PdfDocument docs = null;
string SpireLicensePath = null;

try
{
SpireLicensePath = System.Reflection.Assembly.GetEntryAssembly().Location.Replace("MergeFilesInPDFApp.exe", "license.elic.xml");
licenseFile = new FileInfo(SpireLicensePath);
Spire.License.LicenseProvider.SetLicenseFile(licenseFile);

docs = new PdfDocument();

foreach (var file in sourceFiles)
{
try
{
docs.AppendPage(new PdfDocument(file.Key));
}
catch (System.ArgumentException exArgumentException)
{
throw exArgumentException;
}
catch (Spire.Pdf.Exceptions.PdfException exInvalidPdfException)
{
throw exInvalidPdfException;
}
catch (System.IO.FileNotFoundException exFileNotFoundException)
{
throw exFileNotFoundException;
}
catch (Exception exException)
{
throw exException;
}
}

docs.SaveToFile(strFilePath);
docs.Close();
}
catch (Exception exException)
{
throw exException;
}
}

Thanks in Advance

sandip.jain
 
Posts: 19
Joined: Mon Feb 16, 2015 8:45 pm

Mon Apr 25, 2016 9:38 am

Hi,

Thanks for your inquiry.
Please kindly note that we take customer's sensitive client data as serious as them. We will never publish or disclose any information of our customer. This is always the promise we keep to our customer and the regulation we must obey. So you can provide us it.
Also, you can replace sensitive client data with other data or remove sensitive client data as long as the document can reproduce your issue.
Please send your sample document to us( [email protected]) via e-mail.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Tue Apr 26, 2016 9:40 am

Hi,

Has your issue been resolved ?
I suggest you use the latest Spire.PDF Pack(Hot Fix) Version:3.6.260.
If your issue still exists, please provide us a sample document, you can send it to us( [email protected]) via e-mail.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.PDF

cron