Hi,
Thanks for your posting and using Aspose.Cells.
Please download and try the latest version: Aspose.Cells
for .NET v7.4.3.3 It works fine.
We have tested your issue with the following code. We have attached the output pdf file for your reference.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\input.xls”;
Workbook book = new Workbook(filePath);
PdfSaveOptions options = new PdfSaveOptions();
options.DefaultFont = “MS Pゴシック”;
book.Save(filePath+“.out.pdf”, options);
C#
Workbook wb = new Workbook(filePath);
wb.Save("Inputout1.pdf");
Thank you.
Hi,
Thanks for your posting and using Aspose.Cells for .NET.
MS-Excel converts the source file into 4 pages pdf as shown in the MS-Excel Print Preview. I have attached the MS-Excel generated pdf for your reference.
Also, I have attached the output pdf generated with Aspose.Cells.
Hi
MS Excel converts the same worksheet into pdfs with
different number of pages depending on the selected printer.
Maybe each printer has its own printable area and
that physical constrints overrides the margin settings of the document.
It is strange but that’s Microsofts’ .
This worksheet has a somewhat narrow margin setting .
Will you try to convert the attached xls
with a printer with wide printable area (less margin) ?
Then I think you’ll get a one page pdf .
I think Aspose.Cells’s PDF conversion should ignore printer selection and
depend only on the document’s paper size and margin settings.
But I wonder if the default printer settings affects the conversion.
Thank you.
Hi,
Thanks for your posting and using Aspose.Cells for .NET.
Please try the following code to get rid of extra page. We have also attached the output pdf for your reference.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\test.xls”;
Workbook workbook = new Workbook(filePath);
PdfSaveOptions opts = new PdfSaveOptions();
opts.OnePagePerSheet = true;
workbook.Save(filePath + “.myout.pdf”, opts);
Hi,
>
> opts.OnePagePerSheet = true;
>
Nooooo.
I’m sorry that onePagePerSheet is not the solution.
Some xls have more than two pages.
If microsoft excel convert a worksheet to 1 page pdf,
it should be converted to a 1 page pdf by Aspose.Cells.
If Excel convert another worksheet to 2 page pdf,
it should be converted to a 2 page pdf by Aspose.Cells.
My issue is that number of PDF pages generated by Aspose
is sometimes more than that of PDF generated by Excel.
> MS-Excel converts the source file into 4 pages pdf
> as shown in the
MS-Excel Print Preview.
> I have attached the MS-Excel generated pdf for
your reference.
I’ve found that when Excel converts a worksheet to PDF,
the pagebreak is affected by two factors,
first the current document’s page settings and
second the current printer’s page settings.
Maybe your default printer has smaller paper size than mine.
Please use ISO 216 A4 size(297mm*210mm) printer settings with
top/left/bottom/right margin = 5mm/5mm/5mm/5mm. which is the
same with the document’s page settings.
Hi,
Thanks for your posting and using Aspose.Cells for .NET.
Please elaborate your issue more and highlight the issues in a screenshot with red circles. It will help us look into your issue more precisely and we will be able to help you more. Aspose.Cells generate pdf as MS-Excel print preview displays it.
I’ve made a new Post with more simple sample input xls.
This message thread may be closed .
Thank you.
Hi,
Thanks for your posting and using Aspose.Cells.
We have closed this thread. Please refer to your other thread for a reply.
Hi,
Thanks for your feedback and using Aspose.Cells.
It is good to know that your issue is resolved with the latest fix. Let
us know if you encounter any other issue, we will be glad to look into
it and help you further.