Free Support Forum -

Watermark issue when converting to PDF


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
pageSetup.SetHeaderPicture(1, Data)
'Setting the script for the logo/picture
pageSetup.SetHeader(1, “&G”)

'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.

Thank you.


We have fixed the issue mentioned under Ticket ID CELLSNET-28697 in our latest fix release of Aspose.Cells for .NET v6.0.0.2.

We recommend that fit worksheet to 1 page height & width:
PageSetup ps = workbook.Worksheets[0].PageSetup;
ps.FitToPagesTall = 1;
ps.FitToPagesWide = 1;

Please test your requirement with this latest assembly and feed us back with your results.

Thank you


We have fixed this issue in Aspose.Cells for .NET v6.0.0.2. Please test your requirement with this latest assembly and let us know of your feedback.


I’ve tested and it works well!


The issues you have found earlier (filed as 28697) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.