I’m evaluating the CELLS component and I’m running into an issue where when I convert my Excel file which has a watermark (image in the header) to PDF the image covers all the text in the PDF. I’ve tried to use a transparent PNG file as the watermark and it sill covers all the text in the PDF. The code I’m using is:
'Instantiate a new Workbook object.
Dim book As New Workbook(filen)
'Create a Stream object
Dim fstream As New IO.FileStream(FolderLoc & “CopyImage (Large).png”, IO.FileMode.Open)
Dim Data(fstream.Length - 1) As Byte
fstream.Read(Data, 0, Data.Length)
'Get First Worksheet of the Workbook
Dim ws As Worksheet = book.Worksheets(“Invoice”)
ws.PageSetup.Zoom = 100
ws.PageSetup.PrintQuality = 180
'Creating a PageSetup object to get the page settings of the first worksheet of the workbook
Dim pageSetup As PageSetup = ws.PageSetup
'Setting the logo/picture in the central section of the page header
'Setting the script for the logo/picture
'Set Worksheet background image
'Save Xls File to PDF
book.Save(FolderLoc & “Xls2Pdf.Xlsx”, SaveFormat.Xlsx)
Any help would be appreciated. This is the only thing holding me up purchasing the component.
I have tested converting your template Excel file to PDF and found the issue in the generated PDF as you have pointed out. I have logged your issue with an id: CELLSNET-28697. We will figure it out soon.
We have fixed the issue mentioned under Ticket ID CELLSNET-28697 in our latest fix release of Aspose.Cells for .NET v220.127.116.11.
We recommend that fit worksheet to 1 page height & width:
PageSetup ps = workbook.Worksheets.PageSetup;
ps.FitToPagesTall = 1;
ps.FitToPagesWide = 1;
Please test your requirement with this latest assembly and feed us back with your results.
We have fixed this issue in Aspose.Cells for .NET v18.104.22.168. Please test your requirement with this latest assembly and let us know of your feedback.
I’ve tested and it works well!