Print Page | Close Window

Printing PDF Files Shows Some Wierd Lines

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=4029
Printed Date: 17 Apr 24 at 10:49PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Printing PDF Files Shows Some Wierd Lines
Posted By: m_alam
Subject: Printing PDF Files Shows Some Wierd Lines
Date Posted: 27 Nov 23 at 4:17PM
Greetings,
this is first time i am facing such kin of issues. Printing pdf files using qpl shows some wired lines which is not in the original pdf file.

here is the original pdf files:
https://mdsma.net/7426-28.pdf

and here is how it looks like after printing:
https://mdsma.net/a.pdf

and here is the code that i used to print the pdf file:
        public void PrintPDFFile(string pdfFile, double dblPWidth, double dblPHeight, int intCopies)
        {
            int intPrintOPT;
            string strCustomPrinter;
            string dllFile = isIDE ? @"d:\My Work\Visual Studio\DLL.NET\QPL\DLL\DebenuPDFLibraryDLL1811.dll" : $@"{exePath}\DebenuPDFLibraryDLL1811.dll";
            DPL_v1811.PdfModule pdfLib = new DPL_v1811.PdfModule(dllFile, dplKey);
            pdfLib.LoadFromFile(pdfFile, "");
            int docId = pdfLib.SelectedDocument();
            pdfLib.NormalizePage(0);
            pdfLib.CombineContentStreams();
            intPrintOPT = pdfLib.PrintOptions(0, 0, Application.ProductName);
            strCustomPrinter = GetCustomPrinterConfig(ref pdfLib, dblPWidth, dblPHeight, intCopies);
            pdfLib.PrintDocument(strCustomPrinter, 1, pdfLib.PageCount(), intPrintOPT);
            pdfLib.RemoveDocument(docId);
            pdfLib.ReleaseLibrary();
        }

        private string GetCustomPrinterConfig(ref DPL_v1811.PdfModule objRPDF, double dblPageWidth, double dblPageHeight, int intCopies)
        {
            string strPrinterConfig;
            int intWidth, intHeight, intLayout;
            intWidth = (int)Math.Round(25.4d * dblPageWidth * 10d);
            intHeight = (int)Math.Round(25.4d * dblPageHeight * 10d);
            intLayout = intWidth < intHeight ? 1 : 2;
            intLayout = 1;
            strPrinterConfig = objRPDF.NewCustomPrinter(objRPDF.GetDefaultPrinterName());
            objRPDF.SetupCustomPrinter(strPrinterConfig, 1, 0); // REM custom paper size
            objRPDF.SetupCustomPrinter(strPrinterConfig, 2, intHeight); // REM custom paper height
            objRPDF.SetupCustomPrinter(strPrinterConfig, 3, intWidth); // REM custom paper width
            objRPDF.SetupCustomPrinter(strPrinterConfig, 4, intCopies); // REM number of copies
            objRPDF.SetupCustomPrinter(strPrinterConfig, 5, 300); // REM quality 1 = high, 2 = medium, 3 = low, 4 = draft, Or Exact DPI
            objRPDF.SetupCustomPrinter(strPrinterConfig, 6, 2); // REM Color 1 = monochrome, 2 = Color
            objRPDF.SetupCustomPrinter(strPrinterConfig, 11, intLayout); // REM 1 = portrait, 2 = landscape
            return strPrinterConfig;
        }
and following line call the print funcion:
PrintPDFFile(filePath, 8.50, 11, 3);


andy if i just print the pdf file manually then there is not those lines, all smooth and just like the original file.

any help please?

best regards



Replies:
Posted By: Ingo
Date Posted: 27 Nov 23 at 7:39PM
Hi Hassan :) 

Source was a form i think.
I've made the same experiences as you did.
I've tried some of my preview functions and could see the same behavior without printing.
You can render the pdf to an image and you'll see these lines as well - due to this i don't think that the reason ist the printing functionality.
It seems to me that there are additional boxes behind the framed boxes with different dimensions?
The common readers with large dlls in their installation can do better error correction and layout alignment than QuickPDF can do.



-------------
Cheers,
Ingo



Posted By: m_alam
Date Posted: 29 Nov 23 at 4:45AM
Originally posted by Ingo Ingo wrote:

Hi Hassan :) 

Source was a form i think.
I've made the same experiences as you did.
I've tried some of my preview functions and could see the same behavior without printing.
You can render the pdf to an image and you'll see these lines as well - due to this i don't think that the reason ist the printing functionality.
It seems to me that there are additional boxes behind the framed boxes with different dimensions?
The common readers with large dlls in their installation can do better error correction and layout alignment than QuickPDF can do.



yes you are right. source is a pdf form.. so, point of your views.. there is nothing we qpl can do to fix it?


Posted By: Ingo
Date Posted: 29 Nov 23 at 8:41PM
for me it seems to be a special issue with a sloppy made form.
The slim line library QuickPDF won't be able to fix this issue.
Sorry.



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk