New PDF Generation not Production ready

Attached is a DOC and a PDF.
The DOC is dynamically generated from several template DOCs and some DOM manipulation.
The PDF was previously generated with Aspose.Pdf, now we switched to the new mechanism. It is now generated with the new Document.Save( “xyz.pdf”, SaveOptions.Pdf );
The results are rather horrible:

  • Everything is italic instead of just some words
  • The #$NBS placeholders are ignored and simply literally translated
  • Fonts overlap (see the date string on top of the very first page)
  • Different left and right margins on odd and even pages are still not recognized

Overall, this drives us to switch back to the PDF generation with Aspose.Pdf.
Questions:

  • Is this a fault we did? (If yes, please advise what to change to generate better results)
  • Is this an issue of Aspose.Words? (If yes, please tell me when to expect corrections)

Side note: I wonder why this whole PDF generation stuff is so over complicated/difficult to solve?!? There seems to be plenty of PDF generation engines out there (most as a virtual printer) that do nearly 100% correct PDF generations. Maybe you should switch to their way of generating?!
Thanks
Uwe

Hi
Thanks for your request. Which version of Aspose.Words are you using for testing? PDF produced on my side is different from yours.

  1. I cannot reproduce the problem with italic font on my side.
  2. How should #NBS placeholder look like? These placeholders look exactly the same as in MS Word document. Please explain what you mean.
  3. I cannot reproduce the problem on my side.
  4. Mirror margins are not supported. This is the issue #7494 in our defect database. I will notify you as soon as it is fixed.

Please try using the latest version of Aspose.Words for testing.
https://releases.aspose.com/words/net
You are free to choice the path to convert your documents to PDF. However, you need to know that most of the future fixes and enhancements will be done only in the new direct Aspose.Words Document.SaveToPdf approach. So if you are happy with the current state of Aspose.Words + Aspose.Pdf then you can use it. If not, then you should use Aspose.Words Document.SaveToPdf and basically wait until it is good enough for your documents.
Here is a useful article https://docs.aspose.com/words/net/convert-a-document-to-pdf/
Best regards.

The “#$NBS” should behave as Aspose.Pdf does. See e.g.
https://docs.aspose.com/words/net/
Beside that, I am using the latest version of Aspose.Words, downloaded yesterday.

Hi
Thank you for more information. Aspose.Pdf recognizes #$NBS as non-breaking space. This was done because there is no other way to transfer non-breaking space to Aspose.Pdf via intermediate XML. I think you should use simple white space instead of Aspose.Pdf #$NBS.
Regarding other problems, maybe they occur because you are using “Humnst777 Blk BT” font in your document. Could you please attach this font here for testing?
Best regards.

Hi Uwe,
I leave the resolution of the individual issues to Alexey and the support process he follows (e.g. reproduce, log if a defect and so on), I just want to comment on the other things.
#$NBS
#$NBS is an Aspose.Pdf keyword. The fact that it worked in the Aspose.Words + Aspose.Pdf bundle was most likely a “side effect”. Aspose.Words let such text through unchanged to Aspose.Pdf and it picked it up as its control word to do the job. Otherwise, #$NBS and all similar have no meaning (other than plain text) in Word documents and in Aspose.Words. Aspose.Words tries to render documents exactly as MS Word does therefore #$NBS is just normal text. I understand this turns out to be a “backward compatibility” issue for you, but I doubt we should change the “proper” behavior now to replicate the old side effect. Maybe if it affected multiple customers we would have supported it. I think you understand.
Generation
Side note: I wonder why this whole PDF generation stuff is so over complicated/difficult to solve?!? There seems to be plenty of PDF generation engines out there (most as a virtual printer) that do nearly 100% correct PDF generations. Maybe you should switch to their way of generating?!
Well, the best answer will probably be the one that will give you a paradigm shift:
If these “other PDF generation engines” are so good, why do you need Aspose.Words?
The reason is of course because those PDF generation engines only work when you have Microsoft Word installed and when Microsoft Word renders (prints) the document. In Aspose.Words case this is obviously the main difference. There is no Microsoft Word and Aspose.Words tries to do by itself exactly like Microsoft Word does it. And you are right, it is very complicated.
Just think that Microsoft Word has 25+ years of history of great features as well as many ugly quirks. How many developer hours were spent by Microsoft on Word’s page layout and rendering? We are replicating all that at Aspose in our team. I think we are doing pretty well considering all that.

Attached are all fonts I have, related to the project.
Thanks
Uwe

Thank you, Roman
That #$NBS was inserted by us to tell the rendering engine to not break at this space.
How could I achieve this without the #$NBS special character? I found no way so far.

Hi
Regarding #$NBS. You can just insert non-breaking space in MS Word. You can insert it using Ctrl+Shift+Space.
I will check fonts you have attached and back to you shortly.
Best regards.

Thanks, Alexey
Is there a programatic way of doing Ctrl+Shift+Space from within the Aspose.Words object model?

Hi
You can programmatically replace #$NBS with non-breaking space using the following code:

Document doc = new Document(@"Test028\TL NOEtop, NOEtop Alu.de.doc");
doc.Range.Replace("#$NBS", ControlChar.NonBreakingSpace, true, false);
doc.Save(@"Test028\out.doc");

To insert non-breaking space you can use the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("test" + ControlChar.NonBreakingSpace + "test");

Also, see the following link.
https://reference.aspose.com/words/net/aspose.words/controlchar/nonbreakingspace/
Hope this helps.
Best regards.

Hi
I still cannot reproduce the problem with italic text on my side. However, I see that “Humnst777 Blk BT” is rendered as normal text instead of bold text. I logged this problem in our defect database as issue #8226. I will notify you as soon as it is fixed.
Just to be sure, could you please check the version of Aspose.Words dll you are using? To check version of the library, right click on the dll, select Properties from the context menu, then select Version tab. You will see File version.
Best regards.

Hi
The version I am using is 6.2.0.0 as of 22th march 2009.
I see you released a new version yesterday. I will try this one, again.
Thanks
Uwe

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

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

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

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