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

Free Support Forum - aspose.com

doc.Save("Test.pdf") cannot convert table border correctly

Dear support,


Please see the attached comparison. Our source (word format) contain a table with bottom border. We convert it into PDF and JPEG. The Jpg one is fine but pdf one convert into something new.

Before we were using old version aspose.word component. We converted the word into XML first, then use pdf.BindXML and after then SaveFormat.AsposePdf. We did not get above problem in conversion.

However in new version SaveFormat.AsposePdf is missed. We use the method like doc.Save(“Test.pdf”) to convert and get mentioned issue. Could you advice? Thanks.


Hi Mark,


Thanks for your inquiry.

The information you provided here, in order to reproduce/fix the issue on my side, is not complete. Could you please attach a simplified input Word document here for testing. I will check this scenario on my side and provide you more information.

Moreover, based on your current attachment, I have created a sample DOCX file to be able to reproduce this issue on my side; unfortunately, by using the latest version of Aspose.Words, I was unable to reproduce this problem on my side. Please see the attached zip file (Signature.rar) that contains sample input DOCX and generated JPEG and PDF files for your reference.

Could you please check if you are using the latest version (10.5)? Also, please see the following link for downloading and using the latest version of Aspose.Words for .Net:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/default.aspx

If we can help with anything else, please feel free to ask.

Best Regards,

My attached image maybe not clear enough. The problem in on the length of border.


The source file (word) border length is half of page width (only 1 line). But pdf output contain 2 lines, the thinker one has correct length while you can see a thinner line with full page width.

Hi Mark,


Thanks for the additional information.

Could you please attach your input (Word) and output (JPEG & PDF) documents here for testing? I will investigate the issue on my side and provide you more information.

Best Regards,

Thanks for your reply.

Attached is our sample document. Could you test convert to jpg and pdf?

Another new question, we like to convert this word file into pdf PLUS adding “password protect” and “restrict printing”. Could you show me some sample code to do so? Currently we simply use doc.Save(“Test.pdf”) to convert.

Thanks.

Hi,


Thanks for the additional information.

While using the latest version of Aspose.Words i.e. 10.5.0 and the input document you attached, I was unable to reproduce this issue on my side. I am attaching here the generated PDF file for your reference. Please see the attachment (out.pdf).

Moreover, to set permissions on the PDF document and to restrict printing, please visit the following link for details:
http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.saving.pdfsaveoptions.encryptiondetails.html

I hope, this will help.

Best Regards,

Thanks for your reply. PDF permission is fine now.

However the problem for the “signature underline” still occur. You can see my attachment (pass = 234)
We double check we are using Aspose.Words 10.5.0

Following is part of our code, is it different from yours?

Aspose.Words.Document doc = new Aspose.Words.Document(“Test.doc”);
Aspose.Words.Saving.PdfSaveOptions saveOptions = new Aspose.Words.Saving.PdfSaveOptions();
PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails(“234”, “123”, PdfEncryptionAlgorithm.RC4_128);
encryptionDetails.Permissions = PdfPermissions.DisallowAll;
encryptionDetails.Permissions = PdfPermissions.ModifyAnnotations | PdfPermissions.DocumentAssembly;
saveOptions.EncryptionDetails = encryptionDetails;
doc.Save(“Test.pdf”, saveOptions);

Do you think of any system environment can cause the different? Thank you.

Hi,


Thanks for the additional information.

I’m afraid I still can’t reproduce the issue on my side using the latest version of Aspose.Words and the code you provided. Could you please create and attach here a simple little application that enables us to reproduce this issue on our side?

Moreover, I think, in your case, the system environment has nothing to do with this issue. If we can help with anything else, please feel free to ask.

Best Regards,