Free Support Forum - aspose.com

XLS(with box drawing shape) to PDF converson failing

Hi,

I am using the following code to convert XLS to PDF:

Workbook wb = new Workbook();
wb.Open(inputFile);

//Save the document in Aspose.Pdf.Xml format:
wb.Save(“C:\out.xml”, FileFormatType.AsposePdf);


Pdf pdf = new Pdf();
pdf.BindXML(“C:\out.xml”, null);
pdf.Save(“C:\out.pdf”); // < Error occurs here

But an error occurs:

“Unhandled Exception: System.ApplicationException: The reference paragraph for ParagraphRelative positioning is not found:Cell_0_1_0”

It seems to be occurring whenever there is a simple Box in the spreadsheet…(see Book2.xls)

I am using Aspose.Cells 4.4.3.21, and Aspose.Pdf 3.6.2.0 with .NET framework 2.0.50727…


Hi,

Thanks for considering Aspose.

I have tried converting your provided Book2.xls to pdf using Aspose.Cells v4.4.3.1 & Aspose.Pdf v3.6.2.0, i cannot see any error. Can you please check the value of 'files' that you have provided in BinXML method.

Sorry about the ‘files’, I had written the wrong code there, I have corrected it…

I tried with Aspose.Cells 4.4.3.1 and did not receive the error either,

but the problem is that I have to use Aspose.Cells 4.4.3.21 as it contains a fix for another error that I was encountering (http://www.aspose.com/community/forums/post/131910/exception-system.argumentexception-not-a-legal-oleaut-date.occuring-when-trying-to-save-workbook.aspx)…

I guess this error is popping up when using Aspose.Cells 4.4.3.21 only

Hi,

I will move this thread to Aspose.Cells forum. They will reply to you soon.

Hi,

Please try our latest version(4.5.0.0): http://www.aspose.com/community/files/51/file-format-components/aspose.cells/entry133353.aspx I tested using your template file and it works fine without generating any error.

Thank you.

Tried with 4.5.0.0 and still getting the same error :frowning:

Hi,

I don't find any problem, I used Aspose.Cells 4.5 and Aspose.Pdf 3.6.2.5. Atached is the resultant .pdf file, kindly check it. Please make sure that your project is using 4.5. or greater version. If you still could not sort out, make a test project, zip it (containing all the files) and post it here, we will check it soon.

Thank you.

OK tried with latest version of Aspose.Cells and Aspose.Pdf and it worked out…thanks…