Hi
I create a workbook from scratch to which I add 4 worksheets.
On each worksheet, I add a jpeg at the top (company logo) using this code:
Private Function CreateNAVWorksheetHeader(ByVal pSheet As Worksheet) As Integer
Dim strRoot As String = Application.StartupPath
Dim intPicture As Integer = pSheet.Pictures.Add(0, 0, strRoot + "\Data\Images\LOGO.JPG")
pSheet.Cells.Merge(0, 0, 1, 5)
pSheet.Cells.SetRowHeightPixel(0, 75)
Dim objPicture As Aspose.Cells.Picture = pSheet.Pictures(intPicture)
objPicture.IsLockAspectRatio = True
objPicture.HeightInch = 0.64
objPicture.WidthInch = 4.02
objPicture.Placement = PlacementType.FreeFloating
Return intPicture
End Function
When I save the workbook as a Excel file, I can see the picture on each worksheet.
When I save it as a PDF, the image does not appear on the third worksheet (always the same). This is the code I use to save:
Private Sub SaveWorkbook()
Select Case Me.OutputType
Case cReport.enuOutputType.Native
mWorkbook.Save(ReportName)
Case cReport.enuOutputType.PDF
'save as PDF
'TODO Create a temp file and delete it when done
Dim strTempFile As String = "MySpreadsheet.xml"
'Save the document in Aspose.Pdf.Xml format
mWorkbook.Save(strTempFile, FileFormatType.AsposePdf)
'Read the file in Aspose.Pdf.Xml format into Aspose.Pdf
Dim pdf1 As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf()
'Bind the XML file (containing spreadsheet data) with the Pdf object
pdf1.BindXML(strTempFile, Nothing)
'Create the PDF document by calling its Save method
pdf1.Save(ReportName)
Case cReport.enuOutputType.HTML
Throw New NotImplementedException
'https://forum.aspose.com/t/93322
Case Else
Throw New NotImplementedException
End Select
End Sub
Any ideas on how to fix that?