Free Support Forum - aspose.com

Generating a pdf document is giving skewed output

Hi Team,

I am trying to generate a simple pdf document which contains some tables and text. Sometimes the output pdf has completely/partially skewed text. Weirdly, sometimes even if there is just a single line of text or just a single word, I am still getting the skewed output. However, the equivalent word document always has correct output which is not skewed. I have to admit that this issue is ocurring very rarely and really hard to reproduce and that’s why I won’t be able to provide any definite steps or sample code which you can use to replicate it consistently. I am using Aspose.Words 19.7 jar.

Have you ever witnessed any such issue before with pdf documents ? If yes, could you please provide a hint about what could be going wrong here ?
(I have placed a sample pdf and equivalent doc file in the attached zip) skewedOutputs.zip (19.6 KB)

@shubhampandey

We have converted the shared DOC file to PDF using the latest version of Aspose.Words for Java 19.9 and have not found the shared issue. So, please use Aspose.Words for Java 19.9.

@tahir.manzoor
Thanks for your prompt response. Could you please confirm through your testing if the issue exists in 19.7 ? If so, then what should be the course of action ? We just upgraded to 19.7 and again upgrading to 19.9 so soon is not an option.
Thanks !

@tahir.manzoor
Or if you can tell me whether this kind of skewed output is even possible in Aspose through some setting then that would also be really helpful ?

@shubhampandey,

Please make sure that you had attached the correct Word document (“skewed_output.doc”) here for testing; because we are unable to reproduce this issue on our end even when using old Aspose.Words for Java version 19.7 on Windows 10. Please see the PDF files that we generated on our end by using 19.9 and 19.7 versions of Aspose.Words by using the following simple code:

Code:

Document doc = new Document("E:\\skewedOutputs\\skewed_output.doc");
doc.save("E:\\skewedOutputs\\awjava-19.7.pdf");

Can you please also share your OS and JDK versions and any other environment details which will help us to reproduce the same problem on our end? Also, are you using the
Aspose.Words for Java 19.7 (JDK1.6 jar only) version or the regular JAR from Aspose.Words for Java 19.7 package?

@awais.hafeez
OS - Windows 10
JRE - IBM JRE version 7, 64 bit
We are using the regular JAR downloaded from -

https://downloads.aspose.com/words/java/new-releases/aspose.words-for-java-19.7/

@shubhampandey,

I am afraid, we are still unable to reproduce this issue on our end. Can you please confirm that you had provided the correct input Word document i.e. ‘skewed_output.doc’ (the ‘skewed_output.pdf’ is generated from)? Do you see skewed PDF output when converting this ‘skewed_output.doc’ to PDF on your end? Can you please also provide piece of source code to be able to reproduce the same problem on our end?

Unfortunately, we do not know how can Aspose.Words produce such a skewed output from this ‘skewed_output.doc’.

@awais.hafeez
Though I still don’t have the standalone code which would reproduce this issue, however, I have an interesting find. We had been using an older version of Aspose in our previous releases before the current upgrade to 19.7 and things worked fine with that version. I tested our product with multiple versions of Aspose and found that up until 19.6, we are not getting any skewed output. I even tested it using the latest jar i.e. 19.10 and I can still notice the skewed output. So, the skewing of the output starts exactly from version 19.7 as per our observation. I have attached the output pdfs generated using both versions 19.6 and 19.7.

The word outpts generated using both the versions show no problem at all (attached).

Also if I just try and convert the word document to pdf directly, using your sample code then the outputs are not skewed. So simply converting doc to pdf directly won’t reproduce the issue.

I understand that it would be hard for you as well to reproduce the issue without a sample code, but looking at what changed between 19.6 and 19.7 might give you some clue.

Thanks !
skewedCheck_Multi.zip (266.2 KB)

@shubhampandey,

Thanks for the additional information. But, we are still unable to reproduce this behavior on our end. We have logged a ticket in our issue tracking system to investigate this issue further. Your ticket number is WORDSJAVA-2214. There are hundreds of improvements, bug fixes etc that we integrated in each release of Aspose.Words and we are not sure what change can cause this behavior. Please provide us complete steps and piece of source code so that we can also reproduce this issue on our end. Thanks for your cooperation.

@shubhampandey,

It is to update you that we had implemented following prominent features in 19.7 version of Aspose.Words which can cause this issue on your end:

  • Feature to detect SmartArt shape
  • Improved row height calculation in specific scenarios where the cell has vertical text direction
  • Public API for dealing with linked text boxes
  • i.e.It was improved rendering of SmartArts, text boxes, cells. And it looks like you use one of these features in the result document.

Anyway, we are still unable to reproduce the issue on our end unless you share further input (i.e. sample code, steps etc).

@awais.hafeez
Thanks for the update. We’ll try to zero in on these features and get back to you with sample code.