How to center the print result when using AcutalSize

Technical support for Spire.PDF

Moderator: iceblue support

How to center the print result when using AcutalSize

Postby InfraTec » Tue Jul 18, 2017 7:42 am

Hi Support Team,

I have to use the Property PdfPrintPageScaling.ActualSize when printing PDFs. But when using this Option with the actual Version of spire.pdf (3.9) the print result ist shifted and not centered at the page.

With an older Version of the spire.pdf (3.2) what i was using before the print result was centered at the page.

Which Parameter I have to set to get the printed page centered when using the ActualSize Property?

best regards,
Jens
InfraTec
 
Posts: 2
Joined: Fri Jun 16, 2017 12:51 pm

Re: How to center the print result when using AcutalSize

Postby Jane.Bai » Tue Jul 18, 2017 10:13 am

Hello,

Thanks for your inquiry.
Our dev team has made some modifications on the PageScaling property, at present, when you set it as ActualSize, the the print result will lay on the top left rather than center. If you want to get approach to it, you have to do a calculation and see the margin. Never mind, I have added it as a new feature into our schedule. Once there's any progress, I will let you know. Below is the code for margin setting.
Code: Select all
PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(filepath);
            doc.CustomHandleLandscape = true;
            doc.PrintDocument.DefaultPageSettings.Margins = new Margins(150, 150, 150, 150);
            doc.PrintDocument.OriginAtMargins = true;
            doc.PrintDocument.DefaultPageSettings.Landscape = false;
            doc.PageScaling = PdfPrintPageScaling.ActualSize;
            doc.PrintDocument.Print();


Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 430
Joined: Tue Nov 29, 2016 1:47 am

Re: How to center the print result when using AcutalSize

Postby InfraTec » Tue Jul 18, 2017 12:19 pm

Hello Jane,

thanks a lot for the quick reply.

With your code I got the x-direction shift working, but for y-direction it's not working. It doesn't matter what values I set for margins.top or margins.bottom, the print result is not shifted for y-direction.

Do you have any other ideas to resolve my printing Problem?

best regards,
Jens
InfraTec
 
Posts: 2
Joined: Fri Jun 16, 2017 12:51 pm

Re: How to center the print result when using AcutalSize

Postby Betsy.jiang » Wed Jul 19, 2017 2:58 am

Dear Jens,

Thanks for your feedback.
Sorry that we didn't encounter the issue you mentioned with the latest Spire.PDF Pack(Hot Fix) Version:3.9.189. Please try to use this version firstly. If the issue still happens, please share us the input file and the code you were using for testing.

Many thanks,
Betsy
E-iceblue support team
User avatar
Betsy.jiang
 
Posts: 1527
Joined: Tue Sep 06, 2016 8:30 am

Re: How to center the print result when using AcutalSize

Postby Jane.Bai » Thu Jul 20, 2017 7:14 am

Hello Jens,

To put the print result in the center, you could take the following code as a temporary workaround. Make sure you are using the latest version Spire.Pdf3.9.226.
Code: Select all
PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(filepath);
            doc.PageScaling = PdfPrintPageScaling.CustomSacle;
            doc.PrintDocument.Print();

As for the new feature, when it is finished, I will let you know.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 430
Joined: Tue Nov 29, 2016 1:47 am

Re: How to center the print result when using AcutalSize

Postby Jane.Bai » Thu Jul 27, 2017 8:39 am

Hello,

Did the temporary workaround I provided make sense? Could you please give us some feedback at you convenience?

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 430
Joined: Tue Nov 29, 2016 1:47 am

Re: How to center the print result when using AcutalSize

Postby milltownham » Thu Sep 14, 2017 9:42 pm

Has there been any progress on this new feature? I would also like to have my pages print in the centre of each sheet, but when I use PdfPrintPageScaling.ShrinkOversized it places the page at the top of the sheet.
milltownham
 
Posts: 11
Joined: Wed Aug 02, 2017 2:52 pm

Re: How to center the print result when using AcutalSize

Postby Jane.Bai » Fri Sep 15, 2017 8:44 am

Hi milltownham,

Please make sure you are using the right version Spire.PDF Pack(Hot Fix) Version:3.9.285 bacause we made some change and adjustment in the recent versions.
Our Spire.Pdf is based on the "Portrait" orientation in the adobe print settings.
With the below details, you can have a better understanding of the four choices.

ActualSize: printing at the top left with the actual size of the page.
CustomSize: printing in the center with the custom scaling you want.
FitSize(by Default): automatically adjust the size of the content to adapt the page size
ShrinkOverSize: printing in the center with the actual size of the page.

By the way, at present we will not take the new feature into consideration bacause the "ShrinkOverSize" is for center and actual size printing.
If the issue still troubles you, please send your sample pdf file to us via email(support@e-iceblue.com).

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 430
Joined: Tue Nov 29, 2016 1:47 am

Re: How to center the print result when using AcutalSize

Postby Jane.Bai » Wed Sep 20, 2017 8:10 am

Hello milltownham,

How is your issue now?
Could you please give us some feedback at your convenience?

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 430
Joined: Tue Nov 29, 2016 1:47 am


Return to Spire.PDF

Who is online

Users browsing this forum: No registered users and 0 guests