pdf print

C# example for PDF Print SDK

Good afternoon,

I am testing your  VeryPDF PDFPrint command line tool.  I am thinking about buying this tool, but I wanted to test your VeryPDF PDFPrint SDK tool.  I download this tool and am looking at youir c# example and it is not much help.  Do you have any other c# examples I could try using?

Thanks,
==========================
Hi,

"C#" folder in test package is the C# example, you can compile and run this C# example properly.

PDFPrint SDK does support all options which included in PDFPrint Command Line version, for example,

~~~~~~~~~~~~~~~~~~~~~~~~~~
        [DllImport("pdfprintsdk.dll")]
        public static extern int VeryPDF_PDFPrint(string CommandLine);

        public static long PrintDoc(string FullDocumentName, string PrinterName)
        {
            string PrintCommand = PrintCommandTemplate;
            if (LicenseKey != null)
                PrintCommand = PrintCommand.Replace("[LicenseKey]", LicenseKey);
            else
                PrintCommand = PrintCommand.Replace("[LicenseKey]", "XXXXXXXXXXXXXXXX");
            PrintCommand = PrintCommand.Replace("<PrinterName>", PrinterName).Replace("<DocFullPath>", FullDocumentName);

            MessageBox.Show(PrintCommand);
            return VeryPDF_PDFPrint(PrintCommand);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string appPath = Path.GetDirectoryName(Application.ExecutablePath);
            string strPDFFile = (appPath + "\\readme.pdf");
            long nRet = PrintDoc(strPDFFile, "docPrint");
            MessageBox.Show(nRet.ToString());
        }
~~~~~~~~~~~~~~~~~~~~~~~~~~

You can use PDFPrint Command Line to test the command line options first, and then pass the same command line options to VeryPDF_PDFPrint() function in PDFPrint SDK, then you will able to get PDFPrint SDK to print your PDF file correctly.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
docprint pro

docPrint Pro does compatible with Windows Server 2008 R2(64-bit OS)

We have been having problems running your software on 64-bit Windows Server 2008. Is docPrint Pro v.5.0 compatible with Windows Server 2008 R2(64-bit OS)?
========================
Yes, our docPrint Pro v.5.0 does compatible with Windows Server 2008 R2(64-bit OS), can you please let us know what problem did you encounter on this system?

VeryPDF
========================
The software is not writing PDF, even with command line. This is the string I am using:  doc2pdf –i C:\Documents and Settings\csingleton\Desktop\TEST.doc –o C:\Documents and Settings\csingleton\Desktop\TEST.pdf

I enter that into the command line, hit enter and nothing happens.
========================
Please use "" to include input and output filenames to try again, for example,

doc2pdf -i "C:\Documents and Settings\csingleton\Desktop\TEST.doc" -o "C:\Documents and Settings\csingleton\Desktop\TEST.pdf"

We hoping you will get it work at this time.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
pdf parser & modify sdk

Modify your PDF file contents by PDF Modify SDK product

Hello,
We have attempted to work with your code. I have few questions.
4. Why do we need the png file in the code below?
'Render PDF pages to PNG image files first strInPDFFile = Application.StartupPath() & "\F_COC.pdf"
strOutFile = Application.StartupPath() & "\out.png"
strOptions = "-r " & CStr(nDPI) & " -$ XXXXXXXXXXXXXXXXXXXX"
nRet = VeryPDF_PDFParserSDK(strInPDFFile, strOutFile, strOptions) strLogMsg = strInPDFFile & vbCrLf & strOutFile & vbCrLf & strOptions & vbCrLf & "nRet = " & Str(nRet)
    MsgBox(strLogMsg)
    
5. I’ve used F_COC.pdf file in my testing (see attached). Coordinates for text "Voucher"  (as marked on attached  jpg file) returned by PDFParser (Phase I) are:
X1=226; Y1=404; W1=75; H1=18 OldString was "Voucher" and NewString was "ABC":
I’ve used the following calculation in my code:
       Dim x, y, w, h, hPDF, bRet, nPage As Integer
        Dim x1, y1, w1, h1 As Integer
        Dim strOldText, strNewText As String
        x = x1 * 72.0 / nDPI
        y = y1 * 72.0 / nDPI
        w = w1 * 72.0 / nDPI
        h = h1 * 72.0 / nDPI

        'x = 1333 * 72.0 / nDPI
        'y = 237 * 72.0 / nDPI
        'w = 151 * 72.0 / nDPI
        'h = 27 * 72.0 / nDPI
        nPage = 1
        strOldText = txtOld.Text
        strNewText = txtNew.Text

        strOutFile = Application.StartupPath() & "\modified.pdf"
        hPDF = VeryPDF_ModifyPDF_OpenFile(strInPDFFile, strOutFile)
        bRet = VeryPDF_ModifyPDF_ModifyText(hPDF, nPage, x, y, w, h, strOldText, strNewText)
        VeryPDF_ModifyPDF_CloseFile(hPDF) The resulting \modified.pdf file was not changed.
d) What did I do wrong?
e) Please, provide me with a vb.net example which works following my pdf sample.
f) What DPI is used in PDFParser Phase I code? I see no options there to control it. Do I need to?

6. But, probably the most critical question is:
How will these two dlls (Phase I and Phase II) co-exist efficiently.
It looks like I have to open and process the pdf file and their pages twice.
c) First time I need to open the pdf file and ask for text and page images to get text with coordinates.
d) I need to open the file for the second time to update the text and images.
Clearly, opening and processing file twice has a potential for unworkable solution.
Please, provide me with a vb.net code example which will show the architecture of these two DLLs, so process will be very efficient as promised.
Thanks.
==============================================
Hi,

We have attempted to work with your code. I have few questions.
1. Why do we need the png file in the code below?
'Render PDF pages to PNG image files first strInPDFFile = Application.StartupPath() & "\F_COC.pdf"
strOutFile = Application.StartupPath() & "\out.png"
strOptions = "-r " & CStr(nDPI) & " -$ XXXXXXXXXXXXXXXXXXXX"
nRet = VeryPDF_PDFParserSDK(strInPDFFile, strOutFile, strOptions) strLogMsg = strInPDFFile & vbCrLf & strOutFile & vbCrLf & strOptions & vbCrLf & "nRet = " & Str(nRet)
MsgBox(strLogMsg)

This code is used to get the position for a special word, if you have already known the X, Y, Width, Height position for a word, you needn’t call VeryPDF_PDFParserSDK() to generate a PNG image first.
2. I’ve used F_COC.pdf file in my testing (see attached). Coordinates for text "Voucher"  (as marked on attached  jpg file) returned by PDFParser (Phase I) are:
X1=226; Y1=404; W1=75; H1=18 OldString was "Voucher" and NewString was "ABC":
I’ve used the following calculation in my code:
       Dim x, y, w, h, hPDF, bRet, nPage As Integer
        Dim x1, y1, w1, h1 As Integer
        Dim strOldText, strNewText As String
        x = x1 * 72.0 / nDPI
        y = y1 * 72.0 / nDPI
        w = w1 * 72.0 / nDPI
        h = h1 * 72.0 / nDPI

        'x = 1333 * 72.0 / nDPI
        'y = 237 * 72.0 / nDPI
        'w = 151 * 72.0 / nDPI
        'h = 27 * 72.0 / nDPI
        nPage = 1
        strOldText = txtOld.Text
        strNewText = txtNew.Text

        strOutFile = Application.StartupPath() & "\modified.pdf"
        hPDF = VeryPDF_ModifyPDF_OpenFile(strInPDFFile, strOutFile)
        bRet = VeryPDF_ModifyPDF_ModifyText(hPDF, nPage, x, y, w, h, strOldText, strNewText)
        VeryPDF_ModifyPDF_CloseFile(hPDF) The resulting \modified.pdf file was not changed.
a) What did I do wrong?
The default DPI is 150, so your "X1=226; Y1=404; W1=75; H1=18" position is calculated by 150, in the VB.NET_2 example, we are using 300DPI to parse this PDF file. The default position for "Voucher" is [452, 809, 150, 35] when we parse F_COC.pdf file at 300DPI, please refer to following information in output HTML file, ~~~~~~~~~~~~~~~~~ <div style="position:absolute;left:452;top:809;width:150;height:35"><span style="font-style:normal;font-weight:700;font-size:36px;font-family:Helvetica-Bold;color:#000000;">Voucher</span></div>
~~~~~~~~~~~~~~~~~
b) Please, provide me with a vb.net example which works following my pdf sample.

Yes, no problem, please download a new test package from following URL,

XXXXXXXXXXXXXXXXXXXXXX

The new version can change from "Voucher" to "VeryPDF" properly, please refer to following screenshot,

c) What DPI is used in PDFParser Phase I code? I see no options there to control it. Do I need to?

Default DPI is 150 in PDFParser Phase I, however, you can use "-r" parameter to change the default DPI, for example,

nRet = VeryPDF_PDFParserSDK(strInPDFFile, strOutFile, "-r 300 -html -$ XXXXXXXXXXXXXXXXXXXX")

3. But, probably the most critical question is:
How will these two dlls (Phase I and Phase II) co-exist efficiently.
It looks like I have to open and process the pdf file and their pages twice.
a) First time I need to open the pdf file and ask for text and page images to get text with coordinates.
b) I need to open the file for the second time to update the text and images.
Clearly, opening and processing file twice has a potential for unworkable solution.
Please, provide me with a vb.net code example which will show the architecture of these two DLLs, so process will be very efficient as promised.

Phase I and Phase II have been integrated into one pdfparsersdk2.dll library, there hasn’t two DLL files, if you wish modify the PDF file, you need call VeryPDF_ModifyPDF_OpenFile() function to open an output PDF file for writing, and then call VeryPDF_ModifyPDF_ModifyText() to modify each text words.

VeryPDF
=============================================
Thanks. We will test the cases described.
=============================================
Hello,
I had tested the Modify SDK today. I will do more testing later today.
The Modify SDK seems to be working as designed on a "file based" operations, but:
My application has two modes:
1. Design Mode: When user interacts with our UI to determine the changes need to the PDF pages.
2. Batch Mode: When documents are process automatically based on rule definitions user defined in a Design Mode.
Current Modify SDK seem to be adequate for the Batch Mode. In a Design Mode, user expects immediate response from our application.
I don’t think we can achieve the performance goals with the current “file based” operations and I think we need to add a memory based calls.

I am guessing that current Modify SDK works like:
hPDF = VeryPDF_ModifyPDF_OpenFile(PDFFile, strOutFile) – input and output files are open.
bRet = VeryPDF_ModifyPDF_ModifyText(hPDF, nPage, x, y, w, h, strOldText, strNewText) – input pages are read, modifications are performed and output file written.
VeryPDF_ModifyPDF_CloseFile(hPDF) – input and output files are closed.

As indicated above, in Design Mode performance need to be very, very high, so I think I need something like:
newPageImage = VeryPDF_ModifyPDF_GetImageModifyText(oldPageImage, x, y, w, h, strOldText, strNewText)
where:
- oldPageImage is the image I receive from Phase I SDK.
- newPageImage is a modified oldPageImage.
If needed and improve the speed, I could also pass the Text coordinates for a page which is also available to me at the time of this call from Phase I SDK.
So, the function may look like:
newPageImage = VeryPDF_ModifyPDF_ModifyText(oldPageImage, oldTextCoordinateArray, iRowID, strOldText, strNewText) What do you think?
Thanks.
=============================================
Thanks for your new version of PDF Modify SDK product, everything is work fine now.

=============================================
we will include folloiwng new functions in the PDF Modify SDK Phase II,

//This function will place image included in "NewImage" on a PDF page in rectangle defined by x,y,w,h.
BOOL VeryPDF_ModifyPDF_ModifyImage(hPDF, nPage, x, y, w, h, NewImage)

//This function will place text included in "strNewText" on a PDF page in rectangle defined by x,y,w,h and according to Font Definition.
//FontEnhacement is Bold, Italic, Underline, etc.
//You can use any Windows Font to render the new text
BOOL VeryPDF_ModifyPDF_ModifyTextRich(hPDF, nPage, x, y, w, h, strNewText, FontType, FontSize, FontColor, FontEnhacement)

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
pdfcamp printer

PDFcamp Printer

Dear Support,
 
Recently we have some problems in a process that uses pdfcamp printer driver.
 
Our customer uses PDFcamp for converting mailmerged MSWord documents into PDF documents. This was running on a few pc's without any major issues.
But recently a project was launched to use the whole process in a more automated way. Therefore the process was moved from WindowsXP pc's to a Microsoft Terminal Server 2003. During tests everything seemed to run fine.
But when using the new process in production, some of the PDF files are created without any content (size is 0kb) and some are created only partly. For example a 4 pages wide document has the first page printed completely, the second one in the first 25% of the page, the third approx 10% and the fourth page for 50%. The upper part is printed just normally, but the lower part is just a nice white page ....
The process sends approximately 500 MSWord documents in 30-40 minutes to the pdfcamp driver. Before "printing" each document the settings for pdfcamp are set directly in the registry.
 
Is such an issue already know to you?
Do you have any idea what can cause this issue?
Do you have any suggestion to avoid this issue?
 
If you need any further information or have some questions, you can contact me.
 
Thanks in advance for your feedback.
====================================
Hi support,

We were able to solve this issue ourselves and want to inform you about the solution.

Framework:
A VB6 tool performs mailmerge in Winword and uses PDFcamp to generate PDF files from the generated documents in batch.

Issue:
Some PDF files are empty (0kb) and some PDF miss content (last part of a page).

Analysis:
The first files (approx. 10-12) are added quite fast to the spooler.
The following jobs are added to the spooler and processed immediately. The generated PDF files from these jobs are all OK.
The first 10-12 jobs are processed very slow in the meanwhile. Some jobs generate correct and complete PDF files, some have missing parts.
A few jobs added later to the queue by the VB tool are processed quite slow as well (no clue why...).

Solution:
We now monitor the printer spooler in the VB6 tool and if a treshold is reached (currently using 5 jobs), then the tool waits a second and tries again.  This way there are never more than 5 jobs in the printer queue. They are all processed according the First-In-First-Out concept and all processed correctly.
So it seems that the issue (empty and incomplete PDF files) was caused by the fact that PDFcamp was stressed too much and couldn't handle this.

I hope this information helps you in further version of the PDFcamp driver. Or you can help other customers if the same issue or a similar issue is reported.

Best regards,
=================================
Thanks for your message, we suggest you may convert your DOC files to PDF files one by one, please don't convert more DOC files to PDF files at one time, can you work better if you convert just one DOC file to PDF file at one time?

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
advanced pdf tools

Use PDF Linearizer to do the PDF optimisation

When I process the trail version with the attached PDF file the XMP Metadata, Cross Ref. Links, Bookmark, tagged information are missing. Could you plz advise how to check this trial version? If I Check this without any problem I would like to purchase this product.
======================
Please refer to attached PDF file, this PDF file was created by following command line,

pdftools.exe -i D:\temp3\main.pdf -o C:\out.pdf

we are using full version of pdftools.exe application, as you see, the Cross Ref. Links, Bookmark, etc. information are kept in this PDF file.

VeryPDF
=====================
Thanks for your immediate response!

Attached Out.pdf file is not been Linearized could you please check and let me know?

And I have wrongly attached the PDF file. Could you please process the attached Input.pdf and let me know the points are carryout in this PDF file?
=====================
Please download the processed PDF file from following URL, everything is fine in this PDF file,

XXXXXXXXXXXXXXXX

also, Advanced PDF Tools Command Line can't linearize PDF file correctly, you can download PDF Optimizer (PDF Linearizer) from following page to try, you can use PDF Linearizer to linearize PDF file easily,

https://www.verypdf.com/pdfinfoeditor/pdfoptimizer.htm

VeryPDF
=====================
Am sorry that I have not mentioned. I need to do PDF Linearizer. While doing this only I have faced this problem.

Sorry for the inconviences. Could you please do the PDF optimisation "Input.pdf" and send me the link?
=====================
Please download the new version from following URL, this PDF file has been optimized by PDF Linearizer, you can view this PDF file quickly from internet,

XXXXXXXXXXXXXXXXXXXXXXXX

this PDF file was processed by following command line,

pdfopt.exe -mode 2 "C:\test.pdf" C:\out.pdf

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)