Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Apr 26, 2023 4:21 am

hello,

I want to output in B4 when PDF is output.
I coded as below, but it doesn't work.
It was printed in A4, which is the printer's default setting.

// pdf File Load
Spire.Pdf.PdfDocument pdf = new Spire.Pdf.PdfDocument();
pdf.LoadFromFile(Filepath);

pdf.PrintSettings.PrintController = new StandardPrintController();

pdf.PrintSettings.SelectPageRange(1, 1);
pdf.PrintSettings.PaperSize = PdfPaperSizes.B4;
pdf.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize, true);
pdf.Print();

sosiaa
 
Posts: 4
Joined: Wed Jun 24, 2015 6:21 am

Wed Apr 26, 2023 8:49 am

Hi,

Thank you for your inquiry.

I used Spire.PDF Pack(Hot Fix) version 9.4.0 in a .NET Framework 4.8 project in a Windows 10 64-bit environment and your code to do a test. I could not reproduce your issue where the paper size setting does not work,B4 paper size worked.

To help us reproduce and further investigate your issue, please provide us with your PDF file, system environment information, and the name of the printer you used or send them to us via email ([email protected]). Thank you for your help.

Sincerely,
Ella
E-iceblue support team
User avatar

Ella.Zhang
 
Posts: 42
Joined: Fri Apr 07, 2023 7:42 am

Wed Apr 26, 2023 9:08 am

Windows 10 64 Bit
.NET Framework 4.5
Spire.PDF Pack(Hot Fix) 9.4.0
Print Name : iR-ADV C5250
Visual Studio 2013

The debug.PNG file is the status value just before output.
It was set to B4, but the actual output was printed in A4, the default value of the printer.

sosiaa
 
Posts: 4
Joined: Wed Jun 24, 2015 6:21 am

Wed Apr 26, 2023 9:45 am

After setting the default printer setting to B4, the program outputs to A4, so it was normally printed in A4.
The problem is that when the default printer is set to A4, it does not print to B4.

If you need more information, please ask.

sosiaa
 
Posts: 4
Joined: Wed Jun 24, 2015 6:21 am

Wed Apr 26, 2023 10:29 am

I solved it.
When using B4, I set RawKind as follows, and it was output as B4.
(I also needed to adjust the size later)

PaperSize papersize = new PaperSize("B4", (int)PdfPageSize.B4.Width, (int)PdfPageSize.B4.Height);
papersize.RawKind = (int)PaperKind.B4;
pdf.PrintSettings.PaperSize = papersize;

sosiaa
 
Posts: 4
Joined: Wed Jun 24, 2015 6:21 am

Thu Apr 27, 2023 1:24 am

Hi,

Thanks for your feedback and sharing. We are glad to hear that you have managed to solve the problem.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron