Free Support Forum - groupdocs.com

Header/Footer overlapping in certain case, converting from XLSX to PDF in .NET

This is a bit of an edge case, but when the content is very small, headers and footers can overlap.
When rendering xlsx files split-up instead of one worksheet per page, it’s more likely to happen.
Header Footer-Overlapped.zip (23.6 KB)

Is it maybe possible to specify a page-size that I am missing?
I know that it is possible to control how many rows should be rendered onto one page, but I am missing how many columns should be render, or some target page-size.

GroupDocs.Conversion 20.6 was used with default PDF conversion options.

1 Like

@Clemens_Pestuka

You might be familiar with the property ConvertRange from SpreadsheetLoadOptions. When you specify the range for ConvertRange (e.g. A1:I7), it covers both rows and columns. Have a look at this output.zip (16.5 KB). The output has 1 to 7 rows and A to I columns.
Complete code example/snippet:

GroupDocs.Conversion.Contracts.Func<LoadOptions> getLoadOptions = () => new SpreadsheetLoadOptions
{ 
      ConvertRange = "A1:I7"
};
using (Converter converter = new Converter(@"D:/Header+Footer-Overlapped.xlsx", getLoadOptions))
{
      PdfConvertOptions options = new PdfConvertOptions();
      converter.Convert(@"D:/output.pdf", options);
}

Let us know if it is helpful.

1 Like

@atirtahir3

Thank you for your reply :slight_smile:

Yes I have used that option for rendering thumbnails.
It’s working great in that case, as I only care for the first page.
In this use case I will have to render the whole document though, so I did not consider the ConvertRange, especially because I don’t know how many rows or columns the document will have.

1 Like

@Clemens_Pestuka

We’ll investigate it and let you know about the outcomes. Your investigation ticket ID is CONVERSIONNET-4000.

1 Like