Free Support Forum - aspose.com

Error converting from docx to pdf

Hi

If I try to convert my docx document to pdf I get a error message "Cant convert to 259". I have tried to convert a simpel word document to pdf and that was convert OK but not this document.

My code is :

Aspose.Words.Document objDoc = new Aspose.Words.Document("c:\\test.docx");

objDoc.Save("c:\\kim2.pdf");

I have attached the document.

Kim Johansen

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. It seems, this problem is already resolved in the current codebase. The fix will be included into the next hotfix, which will be released within few weeks. You will be notified. As a workaround please try using the following code:

Document doc = new Document(@"Test001\test.docx");

foreach (Section section in doc.Sections)

{

section.PageSetup.FirstPageTray = PaperTray.DefaultBin;

section.PageSetup.OtherPagesTray = PaperTray.DefaultBin;

}

doc.SaveToPdf(@"Test001\out.pdf");

Hope this helps.

Best regards,

Hi Andrey

That works :slight_smile:

Thanks

Kim johansen

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


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