PDF to Image Converter

PDFToImageDrawToHDC2 function

Our gold support receipt number is XXXXXXXXX,

I have been trying to make the PDFToImageDrawToHDC2 function work on the pdf2image com sdk but I am having some problems....

BOOL __stdcall PDFToImageDrawToHDC2(LPBYTE lpPDFData, int nPDFDataLen, HDC hDC,
int nXDest, int nYDest, int nWidth, int nHeight,
const char *szUserPassword, const char *szOwnPassword, int xRes, int yRes,
int nBitCount, BOOL bGrayscale, int nPageIndex);

1. No matter what value I use for nBitCount or bGrayScale, I always get a bi-tonal image (rather than 8 or 24 bit for example).
2. I don't understand the relationship between dpi, nWidth and nHeight. Can I set nWidth and nHeight to 0 or -1?
3. How can I work out the size of the image before I call the function?

I kind of assumed that this function would be the same as PDFToImageDrawToHDC - except that it takes a LPBYTE rather than a file path as input, but it seems to be quite different.

Any suggestions to get it working?
====================================
>>1. No matter what value I use for nBitCount or bGrayScale, I always get a bi-tonal image (rather than 8 or 24 bit for example).

Please refer to following parameter pairs,

nBitCount=1, bGrayScale is ignored, you will get bi-tonal image (black and white image),
nBitCount=8, bGrayScale=FALSE, you will get a 8bit color image,
nBitCount=8, bGrayScale=TRUE, you will get a 8bit grayscale image,
nBitCount=24, bGrayScale is ignored, you will get a 24bit true color image,

if pdf2image SDK folder contains p2isdk.dll file, you can rename p2isdk.dll file to p2isdk.dll.old filename to try again.

>>2. I don't understand the relationship between dpi, nWidth and nHeight. Can I set nWidth and nHeight to 0 or -1?

If you wish display the PDF page to hDC, you need set valid parameters to "int nXDest, int nYDest, int nWidth, int nHeight", please refer to these parameters' definition at below,

Parameters

nXDest: Specifies the logical x-coordinate of the upper-left corner of the destination rectangle.

nYDest: Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.

nWidth: Specifies the width (in logical units) of the destination rectangle and source bitmap.

nHeight: Specifies the height (in logical units) of the destination rectangle and source bitmap.

In one word, "int nXDest, int nYDest, int nWidth, int nHeight" parameters are used to draw the image to target HDC or screen, " int xRes, int yRes " parameters are used to render the PDF page to image, you can set xRes and yRes to 72, 150 or 300 DPI, then PDFToImageDrawToHDC2() function will render your PDF page to image at 72, 150 or 300 DPI, after that, PDFToImageDrawToHDC2() function will draw image to screen at a rectangle which defined by "int nXDest, int nYDest, int nWidth, int nHeight" parameters.

>>3. How can I work out the size of the image before I call the function?

Yes, this can be done easily, you can use following sample source code to get the PDF page count and page size of each PDF page,

--------------------------------------------------------------------
int pagecount = PDFToImageGetPageCount(szPDFFileName);
printf("Filename is: %s\n",szPDFFileName);
printf("Page count is: %d\n",pagecount);
{
for(int page = 1; page <= pagecount; page++)
{
double m_fPageBox[4];
PDFToImageGetPageBox(szPDFFileName,page,m_fPageBox);
printf("Page %3d box is: [%f,%f,%f,%f]\n",page,m_fPageBox[0],m_fPageBox[1],m_fPageBox[2],m_fPageBox[3]);
int nPageWidth = PDFToImageGetPageWidth(szPDFFileName,page);
int nPageHeight = PDFToImageGetPageHeight(szPDFFileName,page);

if(0)
{
_splitpath(szOutputName, drive, dir, fname, ext );
char fname2[MAX_PATH];
sprintf(fname2,"%s%04d",fname,page);
char path_buffer[MAX_PATH];
_makepath(path_buffer,drive, dir,fname2,ext);
nResult = PDFToImageConverterEx(szPDFFileName,path_buffer,NULL,NULL,1,
1018,1590,24,COMPRESSION_PACKBITS,70,TRUE,TRUE,page,page);
}
}
}
--------------------------------------------------------------------

You can call PDFToImageGetPageBox() or PDFToImageGetPageWidth() or PDFToImageGetPageHeight() functions from your source code to read paper size from PDF file easily.

>>I kind of assumed that this function would be the same as PDFToImageDrawToHDC - except that it takes a LPBYTE rather than a file path as input, but it seems to be quite different.
>>Any suggestions to get it working?

No, PDFToImageDrawToHDC() and PDFToImageDrawToHDC2() are use two different technologies to render the PDF page.

PDFToImageDrawToHDC() function is based on PDFToImageConverter() function,
PDFToImageDrawToHDC2() function is based on PDFToImageConverter2() function,

PDFToImageConverter() and PDFToImageConverter2() functions are using two different render engine, in general, you can use PDFToImageConverter2() to render your PDF page to image file, PDFToImageConverter2() is work better.

VeryPDF
====================================

PDF to Word Converter

Do you have PDF to Word DOC, PPT, XLS converter SDK product?

Do you have a COM object that does the *reverse* of Doc Converter COM as described at http://verypdf.com/pdfcamp/doc2pdf_readme.html ?
=======================
Thanks for your message, just for checking, do you wish convert PDF file to DOC, PPT, XLS, etc formats?

VeryPDF
=======================
Yes, that is precisely what I'd like to do. PDF to doc, ppt, xls, rtf, txt, and so on.
=======================
Sorry, we haven’t PDF to DOC, PPT, XLS converter SDK product, however, you can use following products to convert PDF files back to Word, PPT, XLS, etc. formats,

You can use PDF to Word to convert PDF file to RTF, DOC, TXT formats,

https://www.verypdf.com/pdf2word/index.html

you can use  PDF to PowerPoint Converter v2.0 to convert PDF file to PPT document,

https://www.verypdf.com/pdf2ppt/index.html

you can use mini PDF to Excel Converter v2.0 to convert PDF file to Excel document,

http://www.minipdf.com/pdf2excel.htm

we hoping above products will helpful to you.

VeryPDF
=======================

HTML Converter (htmltools)

htmltools.exe is skew the result PDF file

A few months ago, we purchased you’re HTMLTools.exe and have been using it to convert HTML->PDF. The tool has worked great for the most part. However, we notice that after some usage, (daily now, as we have grown in size), the application appears to skew the results. I have attached an example HTML.pdf document and the results are squished.  (also see email chain below for a side by side example)

As of yet, our solution has been to restart the server and things reset back to normal.

To give you a little background.. I host a “ConvertFile” web service. Below is the source code we use to use your tool.  Can you let us know if this is a known issue, or if we are using an incorrect switch statement in the command? Or is there an updated version of the software?

We need to find a fix for this, or I am going to need to look for an alternative solution. I would prefer to not have to change my code and just fix what I have built already.

Any advice is appreciated.

Thank you.
=====================
I have tried following command line, it does convert your HTML file to PDF file correctly,

htmltools.exe -nocenter -width 612 -height 792 -emfheight 792 D:\temp\ComplianceEase.html D:\temp\ComplianceEase.html.pdf

please look at attached PDF file, everything is fine in this PDF file.

Just for checking, can you convert your HTML file to PDF file correctly when you run the conversion in CMD window by manual?

VeryPDF

PDF Password Remover

HELP I Own PDF Password Remover, File Not Opening

Have gotten a new set of files I need to crack...  Even though I have password (want to be able to save without one),  PDF Password Remover tells me Password is not correct (even though same password opens with Adobe Reader)...
====================
We have checked your PDF file, your PDF file was protected by Adobe DRM technology, our PDF Password Remover can't remove the password from encrypted PDF files which protected by DRM technology, it can only remove the password from PDF files which protected by Acrobat standard encryption technology, please understand this matter.

VeryPDF
====================
You don't know of any other tool that might allow me to remove the DRM?   One you might recommend?
====================
As far as I know, there no product can remove the DRM, DRM is strong enough, however, we will try to develop a screen capture software to capture the Adobe Reader screen directly, this will solve the restrictions in DRM protected PDF file completely.

VeryPDF
====================

PDFStamp Command Line

veryOpen() function can’t opan a PDF file at 700MB

Hi there,

We are again running into issue with stamping large files with your latest tool. Downloaded from the link in your earlier e-mail below.
In our VB6.0 code we are converting the source PDF using PDFTools_ConvertPDFToNewPDFFile() method call and then stamping each page in the PDF with some data.

When we test this functionality with very large PDF files, it appears to be converting the file fine but when we try to open the converted file using veryOpen() method call it does not open just returns a negative return code. Our customer has reported  this with about 700 MB PDF file.

This is an issue in their production environment so needs to be fixed ASAP. Please let us know if you have any solution or an updated version that we can use.

I think my Gold Support and order id are in the subject above.

Please let me know how can we resolve the issue. Unfortunately we cannot send you the PDF file we are testing with since it’s a very sensitive date from our customer and we don’t have access to it.

So if you can give us an updated version that can create some sort of diagnostic logs or some way to let us know why is it failing to open the file that would be great!.

Please let me know if it is possible for you to provide an update.
==================================
We apologize for any inconvenience this may have caused to you, veryOpen() method does load PDF file into memory completely, for a 700MB PDF file, it is need about 1000MB ~ 1400MB memory for stamping, this is indeed a huge memory amount, it may cause memory overflow problem. Is it possible for you to break this large PDF file into smaller PDF files before stamping? You can split this large PDF file to some smaller PDF files at 100MB per PDF file, if so, you can use veryOpen() function to stamp these 100MB PDF files without any problem.

VeryPDF
==================================
We have enough memory to load it even at 1400 MB but the open does now tell it why it can not open it.
That is the largest size we need to open and it is a requirement. We don't have time to break the pdfs up and put them back together again.
The customer wants to open it as one file. Their production system can't process these files and they are quite upset.

What can you do to give us some diagnostics to see what is going wrong?
===============================
Would it be possible for you to create a 64-bit set of pdfstamp libraries? That would get around the memory restrictions?
If we can't fix this we will be forced to use another product.
===============================

Create 64-bit set of pdfstamp libraries is good solution, we will create 64-bit set of pdfstamp libraries in the future.

In the meantime, are you using PDFStamp SDK v2.5 version? If yes, please look at "example_for_vc_unicode" folder in the pdfstamp_sdk_v2.5.zip package, you can use this example to add stamp to your 700MB PDF file,

~~~~~~~~~~~~~~~~~~~~
//Register PDFStamp SDK with your License Key
VeryStampReg ("XXXXXXXXXXXXXXXXXXXXX");

id = PDFStampOpen(szPDFFile);
if (id > 0)
{
for(int i = 1; i <= PDFStampGetPageCount(id); i++)
{
if(PDFStampEditPage(id,i) == 1)
{
long nFont = PDFStampSetFontA(id, "Arial Unicode MS", 0, 12, 1, 39);
PDFStampSetFillColor(id, 0x000000FF);
double dbTextLen = PDFStampGetTextWidthExW(id, (unsigned short *)lpData, nLength/2);
BOOL bRet = PDFStampWriteTextExW(id, 100, 200, (unsigned short *)lpData, nLength/2);
PDFStampEndPage(id);
}
}
PDFStampClose(id, szOutFile);
}
~~~~~~~~~~~~~~~~~~~~

The following functions are new series functions for PDF Stamping, we hoping thise functions will able to stamp your large PDF files properly, you may use them to instead of current stamping functions to try,

PDFStampOpen
PDFStampGetPageCount
PDFStampEditPage
PDFStampSetFontA
PDFStampSetFillColor
PDFStampGetTextWidthExW
PDFStampWriteTextExW
PDFStampEndPage
PDFStampClose

VeryPDF