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 Jun 28, 2018 1:17 pm

Hello,
We are converting HTML to PDF using Spire PDF and saving the PDF files to a folder. Once the files are saved we are sending PDF files to print using below code.

Code: Select all
  printerName = @"\\IPAddress\PrinterName";;
                    FileInfo f = new FileInfo(fileName);
                    Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
                    doc.LoadFromFile(f.FullName);
                    doc.PrintSettings.PrinterName = HttpUtility.UrlDecode(printerName);
                    doc.PrintSettings.Copies = 1;
                    doc.PrintSettings.DocumentName = Path.GetFileNameWithoutExtension(f.Name);
                    PaperSize paperSize = new PaperSize();
                    System.Drawing.SizeF size = doc.Pages[0].Size;
                    paperSize.Width = Convert.ToInt16(size.Width);
                    paperSize.Height = Convert.ToInt16(size.Height);
                    paperSize.RawKind = (int)PaperKind.Custom;
                    doc.PrintSettings.PaperSize = paperSize;
                    doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.CustomScale, false, 68f);
                    doc.PrintSettings.SetPaperMargins(0, 0, 0, 0);
                    doc.Print();


Once the printing is done we are getting big gap on top margin of the print. If we look at the PDF that has been sent to the print we don't see any top margin in PDF. Please find the attached PDF file and the Printed image for your reference. Basically we would like to remove the gap(white space area while printing) on top margin.

curvaturepdfapi
 
Posts: 32
Joined: Wed Apr 20, 2016 10:08 pm

Fri Jun 29, 2018 4:37 am

Hello Team,
Is there any update on the margin issue.

curvaturepdfapi
 
Posts: 32
Joined: Wed Apr 20, 2016 10:08 pm

Fri Jun 29, 2018 6:11 am

Dear curvaturepdfapi,

Sorry for late reply.
After testing your case with the latest Spire.PDF Pack(Hot Fix) Version:4.6.8, I didn't find your issue on my side. If you were using old version, please upgrade to the latest version and try again. If your issue still happens, please share us following information for further investigation.
1. Your printer name, e.g. LaserJet P1007
2. Try to print with Microsoft XPS Document Writer, then provide us with the result
3. The OS and Region information, e.g. win7 64bit, China/Chinese
4. The DPI setting of your computer

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jun 29, 2018 6:35 am

Hello Betsy,
Thanks for the reply... Currently we are using 3.8 licensed version. Can we download the latest 4.6.8 dll's and reference them directly in our project?

curvaturepdfapi
 
Posts: 32
Joined: Wed Apr 20, 2016 10:08 pm

Fri Jun 29, 2018 6:43 am

Dear curvaturepdfapi,

Thanks for your prompt reply.
Yes, we have sent you a temporary license file for one month to help remove the warning information, please check and tell us your result after trying the latest version.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jun 29, 2018 6:52 am

Hello Betsy,
I have sent you an test email. Can you please send the license to that email address.

curvaturepdfapi
 
Posts: 32
Joined: Wed Apr 20, 2016 10:08 pm

Fri Jun 29, 2018 7:00 am

Dear curvaturepdfapi,

Ok, we have sent the temporary license to the new address, please have a check.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF