Inconsistent Document Generation from Template

Hi

I’m using Visual Studio 2013, with Aspose Words 16.6.

I’m having an issue when generating documents in different formats when basing the original Words Document object on a template (.dotx) file.

The problem lies with footnotes. When I save the Document object as a docx file, everything is fine, but when I save it as a PDF, there is an excessive amount of space between the line separating footnotes from text, and the first footnote.

I have attached a zip file containing the template file, along with a docx and pdf file generated using the following code:

<pre style=“font-family: “Courier New”; font-size: 12px; background: white;”>License lic = new License();
lic.SetLicense(“Aspose.Total.lic”);

Document doc = new Document(“Report.dotx”);
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Write(“This is some sample text”);
builder.InsertFootnote(FootnoteType.Footnote, “This is a footnote.”);
builder.Writeln(".");

string docxFile = “FootnoteSample.docx”;
doc.Save(docxFile);

SaveOptions options = new PdfSaveOptions
{
SaveFormat = SaveFormat.Pdf
};
string pdfFile = “FootnoteSample.pdf”;
doc.Save(pdfFile, options);

Could you have a look at this, and advise if there’s anything I can do to fix this problem?

Thanks
Chris Fairall.

Hi Chris,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 16.6.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-14008. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Hi

Could you provide an update as to the priority and progress of this issue? It has been outstanding for almost 3 months now.
Thanks
Chris.

Hi Chris,


Thanks for your inquiry. Unfortunately, this issue is not resolved yet.

The issue only occurs with the documents in the compatibility mode, so it does not affect your document as it is not in the compatibility mode.

The document FootnoteSample.docx contains default property SpaceAfter 10pt for paragraphs.

Aspose.Words sets SpaceAfter 10pt for the footnote separator, but in the document this direct property sets to 0.
It seems that Aspose.Words currently applies default settings of the document, but MS WORD does not.

Our product team will further analyze the root cause. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

Thanks for your reply.


While it doesn’t solve the problem entirely, it did point me in the direction of a suitable workaround.

As I understand it, the PDF version uses the Normal style in the paragraph containing the line that separates the text of the document from the first footnote. Because my solution changed the spacing after a paragraph with the Normal style, this problem presented itself. So the workaround is to alter the Normal style to contain no spacing after the paragraph. So I created a separate style based on the Normal style and used that style in the body of the document where I was using the Normal style before, and altered that style to include the spacing.

Thanks
Chris.

Hi Chris,


It is great you were able to resolve this issue on your end. We will inform you via this thread as soon as this issue is resolved in Aspose.Words. We apologize for any inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-14008) have been fixed in this Aspose.Words for .NET 17.2.0 update and this Aspose.Words for Java 17.2.0 update.


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