PDF to TIFF conversion issues

Hi we are having a problem converting the attached PDFs using the "asp_PDFToImageConverter2" method. Following are our parameters:

X Resolution: 200
Y Resolution: 200
Bitcount: 1
Grayscale: False
Compression: 4
Quality: 100

The attached zip files contains both the source PDFs and the resulting TIFFs. A lot of the text is missing from the TIFF images.
===========================
We have fixed this problem to you, please download the new version of pdf2image.dll from following URL to try again,

VeryPDF
===========================
Hello, we tried the fix and it seems to make the conversion a little better. However, most of the text is not readable on the resulting images. Can you take a look? Thanks
===========================
We apologize for any inconvenience this may have caused to you, we have fixed this problem to you, please download the new version from following URL to try again,

XXXXXXXXXXXXXXXX

you can call PDFToImageSetOption2("CheckBWImage", "1"); function before PDFToImageConverter2() to solve this problem, please refer to following sample code,

void main(int argc, char *argv[])
{
if(argc != 3)
return;
PDFToImageSetOption2("CheckBWImage", "1");
int nResult = PDFToImageConverter2(argv[1],argv[2],NULL,NULL,200,200,1,COMPRESSION_PACKBITS,100,FALSE,TRUE,-1,-1);
}

The new version of PDF2ImageCOM.exe does contain a “asp_PDFToImageSetOption2” method, you can call this method from your ASP code to set the option, for example,

Mycom.asp_PDFToImageSetOption2("CheckBWImage", "1");
int nResult = Mycom.asp_PDFToImageConverter2(argv[1],argv[2],NULL,NULL,200,200,1,COMPRESSION_PACKBITS,100,FALSE,TRUE,-1,-1);

VeryPDF
===========================
we are unable to use the call

Call oConvPDF.asp_PDFToImageSetOption2("CheckBWImage", "1")

because it errors out saying that the object does not support this method. I installed the latest pdf2image.dll that you sent us. Also, could you tell us what code should we use for this version of pdf2image.dll ( asp_PDFToImageSetCode)?
===========================
You need use new version of PDF2ImageCOM.exe to instead of old version first, you can run following command line to register new version of PDF2ImageCOM.exe into your system,

PDF2ImageCOM.exe /regserver

asp_PDFToImageSetOption2() is included new version of PDF2ImageCOM.exe, the old version of PDF2ImageCOM.exe doesn’t support this method.

VeryPDF
===========================
PDF2ImageCOM.exe /regserver

The above gives the error "Unexpected error, quitting". Therefore I cannot register it or run it (I am testing under Windows 7, 64-Bit).

We a few questions other questions:

1. What was the problem with these images
2. How does the new fix handle the images
3. How does the new fix affect other images that do not have this problem
4. Can we call oConvPDF.asp_PDFToImageSetOption2("CheckBWImage", "1")  for all images?
5. what code should we use for this version of pdf2image.dll ( asp_PDFToImageSetCode)?

6. Is PDF2ImageCOM.exe a new file that we need to redistribute to our customers? Currently we only distribute the following:

===========================
>>PDF2ImageCOM.exe /regserver
>>The above gives the error "Unexpected error, quitting". Therefore I cannot register it or run it (I am testing under Windows 7, 64-Bit).

You need use administrator privilege to run above command line, if your CMD window hasn’t administrator privilege, it will fail, please notice this matter.


>>We a few questions other questions:
>>1. What was the problem with these images
>>2. How does the new fix handle the images
>>3. How does the new fix affect other images that do not have this problem

This problem is caused by "halftone" during render your PDF file to black and white image, original "halftone" algorithm will erase some dots if its color too shallow. However, if you call oConvPDF.asp_PDFToImageSetOption2("CheckBWImage", "1") method, pdf2image.dll will use another method to process the BW image, this will solve this problem completely.


>>4. Can we call oConvPDF.asp_PDFToImageSetOption2("CheckBWImage", "1")  for all images?

Yes, you can call this function for all of your PDF files.


>>5. what code should we use for this version of pdf2image.dll ( asp_PDFToImageSetCode)?

You can call following code,

Dim oTest, nPageCount, nPageWidth, nPageHeight
Set Mycom = CreateObject("PDF2Image.CPDF2Image")
Mycom.asp_PDFToImageSetCode("XXXXXXXXXXXXXXXXXXXXXX")
Mycom.asp_PDFToImageSetOption2("CheckBWImage", "1");
int nResult = Mycom.asp_PDFToImageConverter2(argv[1],argv[2],NULL,NULL,200,200,1,COMPRESSION_PACKBITS,100,FALSE,TRUE,-1,-1);


>>6. Is PDF2ImageCOM.exe a new file that we need to redistribute to our customers? Currently we only distribute the following:

Yes, you need distribute PDF2ImageCOM.exe to your customers too.

VeryPDF
===========================
I was able to register the exe, however still got the error "object does not support this property or method"

I then found out that the ProgramId of pdf2imageCOM.exe is "pdf2Image.cpdf2image" and not "pdf2tiff.cpdf2tiff" like I have it in my code. Are we dropping "pdf2tiff.cpdf2tiff"? Our code looks like this now:

'Set oConvPDF = CreateObject("PDF2TIFF.CPDF2TIFF")'commented out
Set oConvPDF = CreateObject("PDF2Image.CPDF2Image")
...
oConvPDF.asp_PDFToImageSetCode "XXXXXXXXXXXXXXXXXX"

ixResolution = 200
iyResolution = 200
iBitcount = 1
bGrayScale = False
iCompression = 4
iQuality = 100
...
...
Call oConvPDF.asp_PDFToImageSetOption2("CheckBWImage", "1")
iRes = oConvPDF.asp_PDFToImageConverter2 (sPDFFileName,sDCONewImagePath,"","",ixResolution,iyResolution,iBitcount,iCompression,iQuality,false,true,iPageNum,iPageNum)

...

After changing to "PDF2Image.CPDF2Image", I no longer get the "object does not support this property or method". However, the resulting images have the same problem. Please see attached images.

===========================
Yes, you are right, you need change from "PDF2TIFF.CPDF2TIFF" to "PDF2Image.CPDF2Image" in your code, because "PDF2TIFF.CPDF2TIFF" and "PDF2Image.CPDF2Image" are two different COM interface.

Please download a test package from following URL,
XXXXXXXXXXXXXX
after you unzip it to a folder, please run “test.bat” file, can you get correct TM000001.tif and TM000002.tif files? If yes, it is indicate new version of pdf2image.dll file does work in your system.

VeryPDF
===========================
Hello, thank you for your response, I am now back from vacations and can continue to work on this. I downloaded the zip file but it is password protected. What is the password? Thanks
===========================
Sorry for the inconvenience, because we have updated pdf2image_sdk.zip file for another customer at  03/12/2011, however, I have recover the pdf2image_sdk.zip file just now, please download it from following URL to try again,
XXXXXXXXXXXXXX
after you unzip it to a folder, please run “test.bat” file, can you get correct TM000001.tif and TM000002.tif files? If yes, it is indicate new version of pdf2image.dll file does work in your system.

VeryPDF
===========================
Thank you. I tried to run the test.bat (Run as Administrator) but nothing happened (the images where not created). If I run test.bat without the "Run as Administrator" then I get an error when the bat files tries to register the COM, and two 0 Kb files get created.

I have a separate question:  does your API provides a way to find out if a PDF contains searchable text or not? Thank you,
===========================
This is a strange problem, can you please create a remote desktop account on your test machine? after we logged into your test machine, we will research this problem for you asap.

Sorry, we haven’t an API for this function, however, we suggest you may use our PDF2TXT SDK product to convert your PDF file to text file, if output text file does contain nothing, it is indicate this PDF file doesn’t contain searchable text, otherwise, it is indicate this PDF file contains searchable text. You can download our PDF2TXT SDK product from following page to try,

https://www.verypdf.com/pdf2txt/pdf2txt.htm#dl

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

I got this to run on a different computer with Win XP. However my results are the same. I noticed that your sample code uses the PACKBITS compression to convert the image. When I tried the same compression you use I get the exact image that your sample produces. Can we have this image convert properly using the CCTTIFax4 compression? The issue is that our customers run the PDF to TIFF process unattended using a one-time setup with the following settings:

Compression:4
X res : 200
Y Res: 200
Quality : 100
Grayscale : False
Bitcount : 1

Customers expect this one-time configuration to work for all images since in production they can't monitor each image then change the settings if an image does not come out OK. What would the solution be? Is there a way to use the VeryPDF API to obtain a "suggested" compression to use to convert a particular PDF to TIFF. My guess is that there is no way to do that but just wanted to ask.

We need to provide our customers with a single setup that will work with all PDF images. If we cannot convert this image using the PACKBITS compression, do you have any suggestions on how determine what compression needs to be used to convert an image?

Thank you, Juan

P.S: Thank you for the information on the PDF2TXT SDK, we will consider it. Juan
=========================
Thanks for your detailed information, we have solved this problem in the new version, please download the new version from following URL to try again,

XXXXXXXXXXXXXXXXXX

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)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!