DoNotExpandShiftReturn does not work when DOCX is converted to PDF using C#

Hi the short story is that I want to save a word document as pdf using Aspose.Word.
This word document is created with the following and saved as word and as pdf:

Document doc = new Document();
doc.CompatibilityOptions.DoNotExpandShiftReturn = true;
doc.Save("myWORD.docx");
doc.Save("myPDF.pdf", SaveFormat.Pdf);

If I open the .docx document in Word, then the lines with SHIFT+RETURN are correctly no longer expanded if text alignment justify is used.

If I open the .pdf file in Adobe Reader, then the lines with SHIFT+RETURN are still expanded. Why?

If I open the .docx document in Word and choose to save as pdf then the resulting pdf do NOT have lines with SHIFT+RETURN expanded.

Am I doing something wrong?

Hi Allan,

Thanks for your query. I have tested the scenario and have not found any issue with DoNotExpandShiftReturn. Please use the latest version of Aspose.Words for .NET 11.0.0. It would be great, If you explain your issue in detail and share your .docx and PDF file for investigation purposes.

Hi again and thanks for the quick reply.
I have now upgraded to 11.0 from 10…8, but I still have the problem.<
Here is the sample code:

Document doc = new Document();
doc.CompatibilityOptions.DoNotExpandShiftReturn = true;
DocumentBuilder builder = new DocumentBuilder(doc);
string html = "<p style='text-align:justify'>Hi there, now I am going to make a test regarding CompatibilityOptions.DoNotExpandShiftReturn. If this works then the end of this sentence should not have expanded spaces between words.<br>This is a new sentence after a linebreak.</p>";
builder.InsertHtml(html);
doc.Save(@"c:\temp\myWord.docx");
doc.Save(@"c:\temp\myPdf.pdf", SaveFormat.Pdf);

I have attached the resulting word and pdf files. Notice how the line before the linebreak is expanded in the pdf file and not in the word file. The word file is correct.

Hi Allan,

Please accept my apology for late response. I have checked your shared .docx file and it seem fine to me. However, This is an issue with output PDF file. I have logged this issue in our issue tracking system and you will be notified via this forum thread once this issue resolved.

I have created two documents with true/false values of DoNotExpandShiftReturn. Please see documents in attachment. I have used the following code snippet.

Document doc = new Document();
doc.CompatibilityOptions.DoNotExpandShiftReturn = false;
DocumentBuilder builder = new DocumentBuilder(doc);
string html = "<p style='text-align:justify'>Hi there now I am going to make a test regarding CompatibilityOptions.DoNotExpandShiftReturn. If this works then the end of this sentence should not have expanded spaces between words. This is a new sentence after a linebreak.</p>";
builder.InsertHtml(html);
builder.InsertBreak(BreakType.LineBreak);

html = "<p style='text-align:justify'>These lines of text end with manual line break These lines of text end with manual line break These lines of text end with manual line break These lines of text end with manual line break These lines of text end with manual line break These lines of text end with manual line break These lines of text end with manual line break This is a new sentence after a linebreak.</p>";
builder.InsertHtml(html);
doc.Save(MyDir + @"DoNotExpandShiftReturn-false.docx");

Hi again.
Just out of simple curiosity, is this problem in the todo-list for the next release?
I ask because I see the newest release (version 11.1) still has the bug.
Do you have a release date for the next version?
Kind regards
Allan Lorentzen

Hi Allan,

Thank you for inquiry. Unfortunately, your issues are pending for analysis. Once our developers analyse this issue, we will be able to provide you an estimate. You will be notify as soon as it is fixed. Sorry
for inconvenience.

Hi Aspose Team
I have a few bugs reported in February and March 2012 (search for all_attack and see).
I was wondering if there was any way I can see which bug number my issues are tied to, so that I can see when a new release is out wether my bug was fixed or not. Is there any way to see that my post is related to bug WORDNET-XXXX ?

Hi Allan,

Thanks for your query. We update our customers about the status of issues via Aspose.Words forum. Please find below your bug tracking list:

  1. DoNotExpandShiftReturn and save as PDF problem - WORDSNET-5868 (Unresolved)

Please let me know if you have any more queries.

Hi,
WORDSNET-5868 has been resolved? Even am facing the issue with latest version of Aspose.words. Last paragraph in PDF docuement gets stretched to right when converted from word document. But in Word document it looks fine.

Hi Jayaprakash,

Thanks for your inquiry. I am afraid this issue (WORDSNET-5868) has now been postponed till a later date due to some other important issues and new features. We will inform you as soon as there are any further developments.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-5868) have been fixed in this .NET update and this Java update.

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