With pSheet.PageSetup
.SetHeader(0, pLeft)
.SetHeader(1, pCenter)
.SetHeader(2, pRight)
If pLogoSection > enuHeaderSections.None Then
Dim strLogoURI As String = Application.StartupPath + "\test.JPG"
If Not IO.File.Exists(strLogoURI) Then
Throw New Exception("Cannot get image >>\test.JPG<<")
End If
Dim inFile As IO.FileStream
inFile = New System.IO.FileStream(strLogoURI, System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim binaryData(Convert.ToInt32(inFile.Length)) As Byte
Dim bytesRead As Int32 = inFile.Read(binaryData, 0, Convert.ToInt32(inFile.Length))
.SetHeaderPicture(pLogoSection, binaryData)
.SetHeader(pLogoSection, "&G") 'Image script
End If
End With
When I pass the parameters to have it in the center section, it appears perfectly centered when I save the report as an Excel file. When I save the same report as a PDF file, the picture is not centered.
Any idea why? I have attached the XML file for you to test.
Which version of Aspose.Cells and Aspose.Pdf you are using . Kindly try the latest versions of Aspose.Cells (4.4.1.9 : you may download it from the thread: <A href="</A>) and (3.6.2). If you still find the problem, please do post your saved excel file and output pdf file. We will check it soon.</P>
<P>Thank you.</P>
We are working on this issue.Thanks for your patience.
In Ms Excel, if the width of center section in the header is more than 1/3 of the page width, the text will auto expand to left and right section, even they can overlap others. But Pdf coud not implement it.
We are looking how to do as Excel with Pdf.The error of the current version is caused by we try to adjust the width of the section.