Catch particular exception by Exception Handling in Aspose.PDF for .NET

Is there any exception handling for the captioned component? I would like to trace up errors from an exception log (if any) during the time of document conversion. Thanks!

Regards,

Ken

Hi,

Aspose.Pdf has been designed to handle all internal error internally with out intervention from the developer. However the errors which cannot be handled internally are presented to the higer level code in the form of exceptions which the developer can catch with a normal try catch block.

Thanks.

Hi,

Thank you for your information.

It is appreciated if you could provide some useful exception type provided by Aspose.pdf component.

Thanks,

Ken

Hi,

Right now only one exception can be explicitly thrown and catch by the developer if IsFontNotFoundExceptionThrown property of Pdf class is set. There is no other property that can be set by the developers using Aspose.Pdf component.

Thanks.

For common problems, ApplicationException will be thrown.

Hi,

Thank you for your information.

Apart from the case of Fonts Not Found, is there any other cases could be handled by the said exception property? e.g. different table style

Please kindly advise.

Thanks,

Ken

Dear Ken,

Sorry there is no other exceptions defined. You can only catch the ApplicationException and handle it based on the error message in it. Sorry for the inconvenience.

Dear Tommy,

We found that all Chinese documents with fonts, 新細明體, were not converted into .pdf file if we catched the FontsNotFoundException (but I'm sure that the said font is absolutely available in the running machine).....please kindly advise.

Thanks,

Ken

Dear Ken,

Are you converting Word documents into Pdf? Can you please provide example that can reproduce this error?

Dear Tommy,

Yes, we are converting Word doucments into pdf. Attached please find a sample file for your reference. The PDF conversion could not be work if we catched pdf.IsFontNotFoundExceptionThrown. Here is the source code of our program:

***************************************************************************************

Aspose.Words.Document srcDoc = new Aspose.Words.Document(inFileName);<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

MemoryStream xmlDoc = new MemoryStream();

srcDoc.Save(xmlDoc, Aspose.Words.SaveFormat.AsposePdf);

xmlDoc.Position = 0;

Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();

pdf.IsImagesInXmlDeleteNeeded = true;

pdf.IsFontNotFoundExceptionThrown = true;

pdf.BindXML(finalDoc, null);

pdf.Save(outFileName);

pdf = null;

********************************************************************************************

Please kindly advise.

Thanks,

Ken

Hi,

I have been able to reproduce this error and have logged this as PDFNET-4262 in our issue tracking system. We will try our best to resolve this issue as soon as possible.

Thanks.

Hello Ken,

Thanks for using our products.

In latest release versions of Aspose.Words, we have introduced a method of converting word documents directly into PDF format without using Aspose.Pdf. Now you can accomplish your requirement of converting word files into PDF format by only using Aspose.Words. I have tested the scenario while using Aspose.Words 9.6.0 over Windows7 Enterprise 64Bit and I am unable to notice any problem while converting the document that you have earlier shared. Please take a look over the attached resultant PDF that I have generated.

For more information regarding Direct-to-PDF method of Aspose.Words, please visit How-to: Convert a Document to PDF

In case you still face any problem or you have any further query, please feel free to contact. We apologize for the delay and inconvenience.

The issues you have found earlier (filed as 4262) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.