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.

Thu Nov 16, 2017 9:17 pm

I have installed Free Spire.PDF to VS2010 via NuGet in order to evaluate using it for document printing. I have run into two issues that I have not been able to figure out how to resolve.

First, when printing documents, the print image does not fill the page. I have tried different documents and different printers with the same result using the following code:
Dim pdf As New PdfDocument
pdf.LoadFromFile("C:\apps\9000015200B01.pdf")
pdf.PageScaling = PdfPrintPageScaling.FitSize
pdf.PrintDocument.Print()
I see that there are some other posts relating to this issue but with a hotfix to the commercial version. I'm not sure if I'm missing some code or need the hotfix.

Second, the files that will need to be printed are in a read only file structure. I had to move files to a full permissions folder in order for the LoadFromFile method to be able to access the files without a permissions error. Is there a way to access read only files?

Thanks for your help.

meprieve
 
Posts: 4
Joined: Wed Nov 15, 2017 7:28 pm

Thu Nov 16, 2017 10:11 pm

Using:
pdf.PageScaling = PdfPrintPageScaling.CustomSacle
with no other settings changes appears to have resolved the scaling problem.

meprieve
 
Posts: 4
Joined: Wed Nov 15, 2017 7:28 pm

Fri Nov 17, 2017 4:02 am

Hello,

Thanks for your inquiry.
This is a known issue in the free version, and we have fixed it in our commercial version. To avoid it, you need to upgrade your dlls to the commercial version(Spire.PDF Pack(Hot Fix) Version:3.9.457), or you could only set the permissions by yourself when you use free version.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Feb 28, 2018 5:36 pm

Hello again,

I have run into .pdf files that do not scale to the page properly when using pdf.PageScaling = PdfPrintPageScaling.CustomSacle or any of the other values for that property. I would still like to try to get this version to work. What did you mean by 'you could only set the permissions by yourself when you use free version'? What permissions? Where?

Are there printer settings that should be set a certain way?

meprieve
 
Posts: 4
Joined: Wed Nov 15, 2017 7:28 pm

Thu Mar 01, 2018 3:29 am

Hello,

Thank you for your feedback.
In regards to the print issue, could you please provide your sample document and point out the issue to help us look into it?
For the second issue, I mean you need to give a full permission to your document. Let's just put the previous answer aside. I did a test and found the commercial version could load and print the read-only files without any error. How is the case on your side? If it is not resolved, please also send us a read-only sample file to us for investigation?

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Mar 01, 2018 3:39 pm

Thank you for the prompt reply,

I have included two PDF files in the attachment. The print results I am getting with the scaling option used written on each page are in one file. The file that is being printed is the other file.

The code used to print is:
Dim pdf As New PdfDocument
pdf.LoadFromFile(drawingFilePath)
'pdf.CustomScaling = PdfPrintPageScaling.ShrinkOversized
'pdf.PageSettings.Size = PdfPageSize.Letter
pdf.PageScaling = PdfPrintPageScaling.CustomSacle
pdf.PrinterName = outputPrinter
pdf.PrintDocument.Print()
pdf.Close()
The commented lines are from other settings that I have tried with no success. Using the CustomScaling option settings usually made it worse.

meprieve
 
Posts: 4
Joined: Wed Nov 15, 2017 7:28 pm

Fri Mar 02, 2018 9:21 am

Hello,

Thanks for your feedback.
I found that you are using the deprecated method, please use the commercial version and change your code to
Code: Select all
Dim pdf As New PdfDocument
pdf.LoadFromFile(drawingFilePath)
pdf.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize)
pdf.Print()


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Mar 09, 2018 9:43 am

Hello,

How is the issue now?
Your feedback would be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.PDF