Hello,
I'm using the docPrint PDF Driver as a virtual printer from a console application. I am setting the PrinterSettings.PrintToFile to true and setting the PrinterSettings.PrintFileName. Is there a way to set the output file type to .tif without displaying the SaveAs window. If I use pdfconfiggui.exe to set the Auto Save and Output Type it ignores the PrinterSettings.PrintFileName.
Thank you for your time,
Customer
---------------------------------------------------
Please download Document Printer SDK (docPrint SDK) from this web page,
https://www.verypdf.com/app/document-converter/try-and-buy.html#buy_sdk
https://www.verypdf.com/artprint/docPrint-sdk.zip
docPrint-sdk.zip contains the details about how to set the output filename before printing.
You can call SetOutputFileName() function to set the output filename to docPrint PDF Driver before you print a document to it, for example,
SetOutputFileName("D:\\verypdf-out.tif");
BOOL GetConfigFilePath(char *lpszDesktopPrograms, int length)
{
HKEY hCU;
DWORD dwType;
ULONG ulSize = MAX_PATH;
HKEY hrkey = HKEY_CURRENT_USER;
memset(lpszDesktopPrograms, 0, length);
hrkey = HKEY_LOCAL_MACHINE;
if (RegOpenKeyEx(hrkey, "SOFTWARE\\verypdf\\docprint",
0, KEY_QUERY_VALUE, &hCU) == ERROR_SUCCESS)
{
RegQueryValueEx(hCU,
//"Personal",
"ConfigFile",
NULL,
&dwType,
(unsigned char *)lpszDesktopPrograms,
&ulSize);
RegCloseKey(hCU);
}
else
return FALSE;
return TRUE;
}
void InitialIniFileName(char *lpszIniFilename)
{
GetConfigFilePath(lpszIniFilename, MAX_PATH);
}
void SetOutputFileName(const char *lpszOutputFile)
{
if(lpszOutputFile == NULL || lpszOutputFile[0] == 0)
return;
char szIniFilename[300];
InitialIniFileName(szIniFilename);
//Set the output filename to docPrint
WritePrivateProfileString("AutoSave", "IsAutoSave", "1", szIniFilename);
WritePrivateProfileString("AutoSave", "OutputFile", lpszOutputFile, szIniFilename);
WritePrivateProfileString("AutoSaveOptions", "m_bCreateFileForEachPage", "1", szIniFilename);
WritePrivateProfileString("AutoSaveOptions", "m_strColorDepth", "24", szIniFilename);
WritePrivateProfileString("AutoSaveOptions", "m_strResolution", "400x400", szIniFilename);
WritePrivateProfileString("AutoSaveOptions", "m_bGrayscale", "0", szIniFilename);
//Use run length compression arithmetic for TIFF file
WritePrivateProfileString("AutoSaveOptions",".tif","-compress rle",szIniFilename);
}