Free Support Forum - aspose.com

Excel To PDF moves "Shape"


#1

When converting Excel to PDF we have encountered a positioning problem with placed ‘Shapes’.

In our example the shape moved more to the right, than it was in the base xlsx document.

Conversion Code:
MyGlobalSettings has only overriden the function “GetStandardHeaderFooterFontStyleName”.

public static void CreatePdfFromExcel(Stream inWordDocumentStream, Stream inPdfOutStream)
{
    var tmpDocument = new Aspose.Cells.Workbook(inWordDocumentStream);
    tmpDocument.Settings.GlobalizationSettings = new MyGlobalSettings();

    tmpDocument.Save(inPdfOutStream, Aspose.Cells.SaveFormat.Pdf);
}

Excel and result.zip (44.9 KB)


#2

@newwin-sws,

Thanks for the sample code and template file.

Please try our latest version/fix: Aspose.Cells for .NET v19.2.7 (attached)
Aspose.Cells19.2.7 For .Net2_AuthenticodeSigned.Zip (4.8 MB)
Aspose.Cells19.2.7 For .Net4.0.Zip (4.8 MB)

I tried your exact code segment with your template file using v19.2.7, it works fine and the shapes are not moved and retained its position.

Let us know with more details and samples if you still find any issue with v19.2.7.


#3

Thank you for your fast response.

I have testet it now with 19.3.0 (via Nuget .Net4.0).
I also used a slightly different formated xlsx to create the issue this time.

The two shapes with the text ‘Visum’ move more to the right Border of the table when exporting as pdf.

Excel to PDF different Format.zip (46.5 KB)


#4

@newwin-sws,

I have tried to reproduce scenario using latest version Aspose.Cells for .NET 19.3.0 but could not observe this issue. Please explain the issue in detail along with the comparison images of expected output PDF/source Excel file with the program output PDF. We will analyze the information and provide assistance accordingly.


#5

The Issue ist the space between ‘Visum’ and the right cell line from excel.

The red arrow points at the difference between excel and created pdf.
Difference.png (11.7 KB)


#6

@newwin-sws,

I have converted the template file to PDF using Excel 365 and observed the result similar to the one created by Aspose.Cells. It seems to be expected behavior as seen in Excel created PDF as well where shape has moved to right side. You may please check it using Excel and provide the feedback.
ExcelPdf.pdf (40.0 KB)


#7

Thank you for your reply. We have tried the same and have seen a difference from 1-2px between aspose, Excel_save_as_PDF and Excel_Print.

We see that this difference is not your fault, but rather excel’s and we’ll inform our client about this issue.

greetings


#8

@newwin-sws,

Good to know that you have sorted it out now. Feel free to contact us any time if you have further queries or issue, we will be happy to assist you soon.