Would you please tell us how to convert attached PDF file(B4) to a 2048 x 1401 TIFF which is compressed by G4(MMR), With function PDFToImageConverter2Ex()?
We also need a 2048 x 2802 TIFF.
We have purchased PDF to Image Converter COM, and succeed in convert a A4 PDF to a TIFF image with specified size(1728 * 1143 OR 1728 * 2286).
We used the function PDFToImageConverter2Ex(), which is included in PDF to Image Converter COM.
So, we want to know is there any way to convert a B4 PDF to a 2048*1401(OR 2048*2802) TIFF with PDF to Image Converter COM.
Hope to hear from you soon.
Customer
---------------------------------------------
Please use following options to try again,
nResult = PDFToImageConverter2Ex( "D:\test.pdf", "D:\out.png", NULL, NULL, 1, 2048, 1401, 24, COMPRESSION_PACKBITS,100,FALSE,TRUE,-1,-1);
VeryPDF
---------------------------------------------
It was not compressed by G4(MMR), and DPI is not 204 * 98.
We want two kinds of tiff as follow.
Case - 1
DPI : 204 * 196
Width&Length: 2048 * 2802
Compression : G4(MMR)
Case - 2
DPI : 204 * 98
Width&Length: 2048 * 1401
Compression : G4(MMR)
Customer
---------------------------------------------
If you wish use G4, please use following options,
nResult = PDFToImageConverter2Ex( "D:\test.pdf", "D:\out.png", NULL, NULL, 1, 2048, 1401, 1, COMPRESSION_CCITTFAX4,100,FALSE,TRUE,-1,-1);
Can you work fine with above options?
VeryPDF
---------------------------------------------
Sorry, the answer is no.
With above options, both xResolution and yResolution is 150, not 204 * 98.
We also confirmed COMPRESSION_CLASSF204X98_G4, too. with this function, both xResolution and yResolution is OK, but width and length comes to 1728 * 1182, but not 2048 * 1401.
Customer
---------------------------------------------
We have created a new version of PDF2Image SDK to you.
The new version is support following two new functions,
1. Create TIFF files at 2048 * 1401 pixel, with G3 or G4 compression, color depth is 1 bpp,
2. PDFToImageConverter() function support Thread-safe,
the new version is support following two TIFF formats,
Case - 1
DPI : 204 * 196
Width&Length: 2048 * 2802
Compression : G4(MMR)
Case - 2
DPI : 204 * 98
Width&Length: 2048 * 1401
Compression : G4(MMR)
New version of PDF2Image SDK is support following ClassF formats,
#define COMPRESSION_CLASSF 88888888
#define COMPRESSION_CLASSF196 88888889
#define COMPRESSION_CLASSF204X98_G3 88888886
#define COMPRESSION_CLASSF204X196_G3 88888887
#define COMPRESSION_CLASSF204X98_G4 88888888
#define COMPRESSION_CLASSF204X196_G4 88888889
#define COMPRESSION_CLASSF_204X98_2048X1401_G4 88888890
#define COMPRESSION_CLASSF_204X196_2048X2802_G4 88888891
COMPRESSION_CLASSF_204X98_2048X1401_G4 and COMPRESSION_CLASSF_204X196_2048X2802_G4 are two new formats,
COMPRESSION_CLASSF_204X98_2048X1401_G4 is:
-----------------------
DPI : 204 * 98
Width&Length: 2048 * 1401
Compression : G4(MMR)
-----------------------
COMPRESSION_CLASSF_204X196_2048X2802_G4 is:
-----------------------
DPI : 204 * 196
Width&Length: 2048 * 2802
Compression : G4(MMR)
-----------------------
also, the PDFToImageConverter function in new version does support multiple threads, you can use following C++ example code to test multiple thread function,
---------------------------------------------------------------------
#define COMPRESSION_NONE 1 /* dump mode */
#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */
#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */
#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */
#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */
#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */
#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */
#define COMPRESSION_CLASSF 88888888
#define COMPRESSION_CLASSF196 88888889
#define COMPRESSION_CLASSF204X98_G3 88888886
#define COMPRESSION_CLASSF204X196_G3 88888887
#define COMPRESSION_CLASSF204X98_G4 88888888
#define COMPRESSION_CLASSF204X196_G4 88888889
#define COMPRESSION_CLASSF_204X98_2048X1401_G4 88888890
#define COMPRESSION_CLASSF_204X196_2048X2802_G4 88888891
typedef struct PDF2IMAGETHREADINFOtag{
char szPDFName[MAX_PATH];
int dwThreadID;
int iResult;
}PDF2IMAGETHREADINFO,*LPPDF2IMAGETHREADINFO;
static DWORD WINAPI LaunchPDF2ImageThread(LPVOID pParam)
{
LPPDF2IMAGETHREADINFO lpPDF2ImgInfo = (LPPDF2IMAGETHREADINFO)pParam;
int iThreadID = GetCurrentThreadId();
char szOutName[MAX_PATH];
char szFileExt[MAX_PATH];
CHAR drive[_MAX_DRIVE],dir[_MAX_DIR],fname[MAX_PATH],ext[_MAX_EXT];
{
sprintf(szFileExt,"_%d",iThreadID);
_splitpath(lpPDF2ImgInfo->szPDFName, drive, dir, fname, ext );
strcat(fname, "204X98");
strcat(fname, szFileExt);
_makepath(szOutName, drive, dir, fname, ".tif");
int nResult = PDFToImageConverter(lpPDF2ImgInfo->szPDFName, szOutName, NULL, NULL, 300, 300, 1, COMPRESSION_CLASSF_204X98_2048X1401_G4, 100, FALSE, TRUE, -1, -1);
printf("ThreadID = %d, OutName = %s, Result = %d\n",iThreadID, szOutName, nResult);
}
{
sprintf(szFileExt,"_%d",iThreadID);
_splitpath(lpPDF2ImgInfo->szPDFName, drive, dir, fname, ext );
strcat(fname, "204X196");
strcat(fname, szFileExt);
_makepath(szOutName, drive, dir, fname, ".tif");
int nResult = PDFToImageConverter(lpPDF2ImgInfo->szPDFName, szOutName, NULL, NULL, 300, 300, 1, COMPRESSION_CLASSF_204X196_2048X2802_G4, 100, FALSE, TRUE, -1, -1);
printf("ThreadID = %d, OutName = %s, Result = %d\n",iThreadID, szOutName, nResult);
}
return 0;
}
void TestForMultiThread(char *szPDFName)
{
PDFToImageSetProgressCBFunc(NULL);
for(int i = 0; i < 10; i++)
{
LPPDF2IMAGETHREADINFO lpPDF2ImgInfo = new PDF2IMAGETHREADINFO;
strcpy(lpPDF2ImgInfo->szPDFName,szPDFName);
DWORD dwThreadId;
HANDLE hImageOpenThread = CreateThread(NULL, 0, LaunchPDF2ImageThread, lpPDF2ImgInfo, 0, &dwThreadId);
}
}
void main(int argc, char *argv[])
{
if(argc != 2)
{
printf("\"%s\" test.pdf\n", argv[0]);
return;
}
PDFToImageSetCode("XXXXXXXXXXXXXXXXXXXXXXX");
TestForMultiThread(argv[1]);
printf("Press any key to continue...\n");
getchar();
}
---------------------------------------------------------------------
also, the new package is contain a "example_vc_ClassF" folder, you can compile and run it in VC6 directly.
If you encounter any problem with new version of PDFToImageConverter() function, please feel free to let us know.
Related Articles:
Convert PDF file to ClassF compatible TIFF files
https://www.verypdf.com/wordpress/201109/convert-pdf-file-to-classf-compatible-tiff-files-2521.html
How to convert PDF to FAX(TIFF Class F)?
https://www.verypdf.com/wordpress/201208/how-to-convert-pdf-to-faxtiff-class-f-31671.html
PDF to Fax - Convert PDF files to Fax compatible TIFF files (pdf2fax, pdftofax), then you can fax your PDF file easily
https://www.verypdf.com/pdf2tif/pdf-to-fax.html
Acrobat To Fax - Convert PDF files to Fax compatible TIFF files (acrobat2fax, acrobattofax), then you can fax your acrobat file easily
https://www.verypdf.com/pdf2tif/acrobat-to-fax.html