We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word to PDF - Paragraph Numbering Error

Hi

I’ve seen a simlilar error to this on you site which is, as yet, unfixed. However, I wanted to raise a new ticket as I’m not completely sure this is the same problem.

We have an Word document which contains paragraph numbering and when this is converted to PDF format the numbering changes. In the Word doc, the numbering resets to 1 at a certain point (which is correct) but in the PDF the numbering continues - in this case from 3 to 4.

This PDF doc is of cruicial importance to our business and is a legally binding contract. It must be relied upon to be as the initial Word document from which it is created.

Please advise as a matter of extreme urgency. the relevant sample doc’s are attached.

Thanks.

Tim Lambe

Hi

Thanks for your request. This is known issue #5949 in our defect database. I will notify you as soon as it is fixed. As a workaround you can refactor your document. If you need I can change the document and it will be converted to PDF properly. If so please provide me your e-mail.

Best regards.

Hi Alexey

This is such a serious error for us that we may have to try and find another conversion tool if Aspose cannot resolve it within the next couple of days.

In the meantime we’d be grateful if you could amend our source document so it converts to PDF correctly and provide us with an explanation of how we can do this ourselves for other doc’s.

My email address is registered with my Aspose account. I don’t want to post in on a public forum but can send it to you if you provide an address. Failing that, just post the doc’s in your reponse.

Thank you for your assistance.

Yours

Tim Lambe

Hi

Thanks for your request. Here is my e-mail: alexey.noskov@aspose.com.

Best regards.

Hi!

I have good news. Yesterday #5949 has been fixed. We are planning to issue a new release in a few days. Maybe even tomorrow. We’ll notify you when it is available.

We are sorry but PDF export module has some restrictions and we cannot promise 100% conversion fidelity for any arbitrary source documents. Inspecting particular cases we usually can figure out what features or techniques are better to avoid. So please feel free in asking our team for any help.

Regards,

We are happy to tell you that we released new version of Aspose.Words. This version includes fix of issue you found earlier (issue # 5949). You can download new version from here:

Best regards.

We’re getting an exception with the following code:

public static MemoryStream DocToPdf(MemoryStream InputStream)
{
    ValidateLicense();
    Document _InputDoc = new Document(InputStream, null, LoadFormat.Doc, null);
    MemoryStream _HoldingStream = new MemoryStream();
    _InputDoc.Save(_HoldingStream, SaveFormat.Pdf);
    return _HoldingStream;
}

The _InputDoc.Save is throwing an Index out of range exception. If this code is wrong, could you please send me a sample of the correct procedure?

Thanks

Tim Lambe

Hi

Thanks for your request. In the current version of Aspose.Words (v6.0.0) there is two ways to convert DOC to PDF.

  1. Direct conversion to PDF using Aspose.Words (without using Aspose.Pdf). See the following link for more information:
    http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.document.savetopdf_overload_1.html

here is code:

Document doc = new Document(@"Test012\number_error.doc");
doc.SaveToPdf(@"Test012\aw_out.pdf");
  1. Another way is using Aspose.Words and Aspose.Pdf using the following code:
Document doc = new Document(@"Test012\number_error.doc");
//Save in intermediate AsposePdf format
MemoryStream aPdfStream = new MemoryStream();
doc.Save(aPdfStream, SaveFormat.AsposePdf);
//Create Aspose.Pdf.Pdf document
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(aPdfStream, null);
//Save pdf
pdf.Save(@"Test012\out.pdf");

Could you please attach the document that causes the error?

Best regards.

Hi

I can’t provide the doc too easily as it’s being created on the fly, however, it works okay performing the conversion using Aspose.PDF (except for the paragraph numbering problem which this new release is supposed to address).

The API is confusing. Why is there a save type of ‘PDF’ if that can’t be used?

I’m happy to use the SaveToPDF method. I’ll respond if it doesn’t work.

Thanks.

Tim Lambe

Hi

Thanks for your request. The following code also works fine on my side:

Document doc = new Document(@"Test012\number_error.doc");
doc.Save(@"Test012\out.pdf", SaveFormat.Pdf);

You can try to save the generated document in DOC or DOCX format and attach it here for testing.

Regarding numbering issue:

The problem doesn’t occur when I use Aspose.Words (6.0.0) and Aspose.Pdf (3.9.0) to convert DOC to PDF. However the problem occurs if I use direct conversion to PDF using Aspose.Words. So I created new issue #6694 in our defect database.

Best regards.

Here’s the doc which is failing. I believe this may be failing ragardless of which PDF conversion method I use.

Hi

Thank you for more information. Both methods works fine on my side. Could you please create simple test application that will allow me to reproduce the problem?

Best regards.

Hi

I updated to Aspose.PDF 3.9.0.0 (was using 3.8.0.5) and reinstalled Aspose.Words (as the old 5.2.0.0 assembly was still in the Net 2.0 folder) and all is fine now.

Thanks for your prompt assistance.

Tim Lambe

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


This message was posted using Notification2Forum from Downloads module by alexey.noskov.