We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Set header to PDF exported with Aspose.Cells

We found an issue when editing a PDF with Aspose.PDF v. 17.4.0 created exporting an Aspose.Cells.
In details, our flow is:
  • creates a pdf with some images
  • adds to pdf the pages created by Aspose.Cells
  • sets the headers and footers to each page
As you could observe running the code below, in the pages containing the Aspose.Cells the header is rotated and placed at the bottom of the page.

Do you have any suggestion?
Note: We use this flow instead of create a pdf table because we already mapped our data in Aspose.Cells and also because that export is able to split the columns accross multiple pages automatically.
Best regards.

var dataTable = new DataTable(); dataTable.Columns.Add("Column1"); dataTable.Columns.Add("Column2"); dataTable.Columns.Add("Column3"); dataTable.Columns.Add("Column4");

var workBook = new Workbook();
var sheet = workBook.Worksheets[0];
sheet.Cells.ImportDataTable(dataTable, true, 0, 0);
var memoryStream = new MemoryStream();
workBook.Save(memoryStream, new Aspose.Cells.PdfSaveOptions());

var newDocument = new Document();

var page = newDocument.Pages.Add();
page.Paragraphs.Add(new TextFragment(“First page”));

var existingDocument = new Document(memoryStream);

foreach (Page p in newDocument.Pages)
p.Header = new HeaderFooter();
p.Header.Paragraphs.Add(new TextFragment(“Header”));

var resultPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, “result.pdf”);


Hi Pietro,

Thanks for contacting support.

I have tested the scenario using your code snippet and was able to reproduce the issue in our environment. Therefore I have logged an issue as PDFNET-42659 in our issue tracking system. We will further investigate the issue and keep you updated on the status of its rectification. Please be patient and spare us a little time.

We are sorry for the inconvenience.

Best Regards,

any update? or at least one possible workaround?

Hi Pietro,

Thanks for your inquiry.

I am afraid that earlier logged issue is not resolved yet as development team has been busy in resolving other issues in the queue. I have recorded your concerns and requested product team that if they can provide a workaround. We will definitely share updates with you as soon as we have some feedback from relevant team. We really appreciate your patience and cooperation in this regard. Please spare us little time.

We are sorry for the inconvenience.

Best Regards,