Problems with printing documents in A3

Hi there,

we can't print PDF files in size A3 when using Aspose.PDF

With Apose.Words, it works fine.

I found a difference in PageInfo and PageSize values.
I tried to overwrite them, but without success.

We use Aspose.PDF 10.4, but I tested with version 11.9

Do you have any suggestions?

If you have any questions, please do not hesitate to contact me.

Thanks in advance and kind regards,
Lutz

Hi Lutz,

Thanks for your inquiry. Please note PageInfo property is used for page formatting while creating new PDF document from scratch. However for existing PDF document you need to use Rect property to get dimensions of existing PDF Page. You need to use SetPageSize() method to change page dimensions.

Furthermore, for printing from Aspose.Pdf you need to set PageSettings accordingly, otherwise it will take default page setting of the printer. If there is any different in your requirements and my understanding then please share some more details.

pgs.PaperSize = new System.Drawing.Printing.PaperSize("A3", 1169, 1654);

Best Regards,

Hi Tilal,


thanks for your response.

I will try and inform you.

Have a nice day.

Kind regards,
Lutz

Hi Tilal,


I’m sorry, but I don’t get it.
I have been playing around a while, but I am not able to print A3 correctly.
The texts appear somewhere on the paper, and so I enter the correct values for height and width (in points), the orientation does not change.

Do you have any suggestions?

Kind regards,
Lutz

Hi Lutz,

Thanks for your feedback. Please amend your code as following, it will help you to accomplish the task. I have tested the code with a soft printer (Adobe PDF) and unable to notice any issue. Please try this and share the results.

foreach (Aspose.Pdf.Page page in doc.Pages)
{
    height = (int)(page.Rect.Height / 0.72);
    width = (int)(page.Rect.Width / 0.72);

    if (page == doc.Pages[1])
    {
        pageSettings.PaperSize = new PaperSize();
        //pageSettings.PaperSize.Width = width;
        //pageSettings.PaperSize.Height = height;
        pageSettings.PaperSize = new System.Drawing.Printing.PaperSize("A3", width, height);
    }

    page.SetPageSize(width, height);
}

Best Regards,