Copy link to clipboard
Copied
Please advice: we getting garbled prints from plugin if PDFs include CID fonts and sent repeatedly. The plugin runs on Acrobat 11 Standard and is built with Acrobat 11 SDK. The same plugin source code runs on Acrobat 8 Standard built with Acrobat 8 SDK renders correct.
Copy link to clipboard
Copied
Without knowing EXACTLY what your plugin does (in terms of the API calls used and the parameters to them) – no idea…
Copy link to clipboard
Copied
Same source code is used to build with SDK 8 and 11. The former always renders correct, the latter renders garbled CID font after 46 correct tests (i.e. 47th test is garbled).
The code snippets used in plugin to open and print the document are shown below:
PDDoc CAcroDocument::pdDoc = NULL;
CAcroDocument::CAcroDocument()
{
...
CTOR; /* Macro for creating a RaiseAwareConstructor */
avDoc = AVAppGetActiveDoc();
if(avDoc)
{
pdDoc = AVDocGetPDDoc(avDoc);
}
}
PDDoc CAcroDocument::OpenSecureDocument(const char* path, const char* username,
const char* password, char* status)
{
AUTHPROCDATA authProcClientData;
// this definition is isn RndJob.cpp:
#define OPENSECURE_NO_ERR 0
#define OPENSECURE_GEN_ERR 1
#define OPENSECURE_AUTH 2
authProcClientData.m_OwnerName = "";
authProcClientData.m_Password = "";
if (username != NULL && password != NULL)
{
authProcClientData.m_OwnerName = username;
authProcClientData.m_Password = password;
}
DURING
if (path != NULL)
asPathName = MakeFullPath(path);
PDAuthProcEx pAuthProcEx = ASCallbackCreateProto(PDAuthProcEx, &EZAuthProc);
pdDoc = PDDocOpenEx(asPathName, NULL, pAuthProcEx,
(void*)&authProcClientData, true);
if( pdDoc != NULL )
{
ASText filePath = ASTextFromScriptText(path, kASEUnicodeScript);
avDoc = AVDocOpenFromPDDoc(pdDoc, filePath);
}
else{
CloseDocument();
E_RETURN(pdDoc);
}
HANDLER
ShowErrMsg(ERRORCODE);
if( EZAuthStatus == PDPermReqGranted )
{
status[0] = OPENSECURE_GEN_ERR;
if (pdDoc != NULL)
CloseDocument();
}
else
{
status[0] = OPENSECURE_AUTH;
}
pdDoc = NULL;
END_HANDLER
return pdDoc;
}
class RndJob
{
...
RNDIFACE_RETURNCODE PrintDocument();
private:
CAcroDocument m_Doc;
}
RNDIFACE_RETURNCODE RndJob::PrintDocument()
{
....
AVDocPrintParamsRec r;
memset (&r, 0, sizeof(AVDocPrintParamsRec));
r.size = sizeof(AVDocPrintParamsRec);
r.pageSpec = PDAllPages;
// if true, displays dialog boxes; otherwise does not display dialog boxes.
r.interactive = false;
// If interactive is false and cancelDialog is true, aCancel dialog box appears.
r.cancelDialog = false;
r.embedded = false;
r.emitToPrinter = true; // only emitToPrinter or emitToFile must be true
r.emitToFile = false;
r.fileSysName = ASAtomNull;
r.filePathName = NULL;
// Used if emitToPrinter or emitToFile are true. First page to be printed; zero-based; if -1, then all pages are printed
r.firstPage = -1;
r.lastPage = -1;
r.psLevel = 3;
r.binaryOK = false;
r.shrinkToFit = true;
r.doColorSeparations = false;
r.emitFontOption = kAVEmitFontAllFonts;
r.ranges = NULL;
r.numRanges = 0;
r.reverse = false;
r.transparencyLevel = 0; //The transparency level range from 1 to 5
r.emitFileOption = false; //kAVEmitFilePS;
r.emitFlags = kAVSetPageSize | kAVSilent;
r.TTasT42 = true;
r.printAsImage = true;
r.printerHasFarEastFonts = false;
r.tileData = NULL;
r.rasterData = NULL;
r.overrideData = NULL;
r.selectRect = NULL;
r.ocContext = NULL;
r.resPolicy = kAVResPolicySendAtStart;
r.marksFlags = kAVCropMarks;
r.nUpData = NULL;
r.marksStyle = kAVDefaultMarkType;
r.printDialogWasCancelled = true;
r.parentWindow = NULL;
ASPlatformPrinterSpecRec aspr;
memset(&aspr, 0, sizeof(ASPlatformPrinterSpecRec));
aspr.size = sizeof(ASPlatformPrinterSpecRec);
strcpy_s(aspr.printerName, sizeof(aspr.printerName), (LPCTSTR)m_csPrinter);
r.printerSpec = &aspr;
AVDocPrintNupDataRec fldnUpData;
memset (&fldnUpData, 0, sizeof(AVDocPrintNupDataRec));
fldnUpData.size = sizeof(AVDocPrintNupDataRec);
fldnUpData.autoRotate = true;
r.nUpData = &fldnUpData;
DURING
g_EZDidPrint = false;
AVDocPrintPagesWithParams((AVDoc)m_Doc, &r);
if( ! g_EZDidPrint ){
CloseDocument();
E_RETURN(rcINTERNAL_ERROR);
}
else{
E_RETURN(rcSUCCESS);
}
HANDLER
ShowErrMsg(ERRORCODE);
CloseDocument();
return(rcINTERNAL_ERROR);
END_HANDLER
return rcINTERNAL_ERROR;
}
Copy link to clipboard
Copied
A few things that come to mind…
- Why is binaryOK=false? Any printer made in the last 15 years will support binary.
- Why is printAsImage=true? Don’t you want a real printout instead of an image?
- printerHasFarEastFonts=false – do you know that it true or just guessing?
- Why is resPolicy = kAVResPolicySendAtStart? Why not SendPerPage?
Copy link to clipboard
Copied
Thanks - appreciate the response very much!
Going to try the changes and let you know the results.
Copy link to clipboard
Copied
Getting the same result ( fist dozen or so PDFs with CID render clear then print is garbled; only VM reboot clears garbling)
Changes made:
checked with printer driver and set binaryOK=true; printAsImage = true; printerHasFarEastFonts = true;
resPolicy is set to "SendPerPage".
Is there any other setting to ignore CID fonts?
Is there any way to run PDF optimizer?
Copy link to clipboard
Copied
What API should be used for DDE printing? Is there any example for c++?
Copy link to clipboard
Copied
Why print as image? This is supposed to be a desperate measure for use when there are other issues.
Copy link to clipboard
Copied
To repeat the test, built the plugin with print parameter r.printAsImage = false;
Unfortunately, CID fonts are still garbled after several attempts, i.e. first, second, third .. (not always the same number) attempts render perfect CID fonts.. then it garbles. Same as with print parameter r.printAsImage = true;
Copy link to clipboard
Copied
What API should be used for DDE printing? Is there any example for c++?
Copy link to clipboard
Copied
Let's assume for now that you've found an Acrobat bug.
1. Did you report this?
2. What version of Acrobat 11 Standard are you using?
3. Acrobat 11 is going out of support in a few months, fixes are VERY unlikely if your version is up to date. Does it happen in the current product?
Copy link to clipboard
Copied
Additional question: you say a reset of the VM is needed to clear it. That's very surprising. Is the problem not resolved (temporarily) if the end user simply restarts Acrobat?
Copy link to clipboard
Copied
We use Acrobat XI standard version 11.0.20 with latest updates.
Question 1: Please advice how to report the bug? Search thru adobe web site does not show a way.
Question 2: What version of Acrobat standard supposed to fix the bug?
Question 3: When the version of Acrobat standard that includes the bug fix should be available, can we use beta?
Our extensive tests verified that simple restart of Acrobat 11 standard does not fix the CID fonts garbling, user logoff/on does not fix the CID fonts garbling, only VM reset does.
When the VM is restarted, about 46 PDFs with CIDs render correct prints, then 47th(or so) attempt is garbled.
Once the print got garbled the only way to get back to correct prints is to restart the VM.
Kindly, please advice on questions 1,2,3.
Copy link to clipboard
Copied
1 - http://www.adobe.com/products/wishform.html (came right up when doing a web search – top hit)
2 – We don’t know yet if the problem is our software or your environment. Once you report the issue and provide all the necessary info on how to reproduce, we will investigate, determine amount of work to fix and if/when to do it. However, see below…
3 – See below…
I should also point out that Acrobat XI will reach end of support this October (https://blogs.adobe.com/documentcloud/adobe-acrobat-xi-and-adobe-reader-xi-end-of-support/). Keep that in mind if this work is something that will live beyond October.
Copy link to clipboard
Copied
Are you aware that Acrobat XI was simply replaced by Acrobat DC? Because DC isn't a number, I've found some people assumed it was a whole different product rather than an upgrade.
Copy link to clipboard
Copied
No we are not aware that Acrobat XI standard was replaced by Acrobat DC standard.
We will test with Acrobat DC standard demo.
When Acrobat DC standard will reach end of support?
Copy link to clipboard
Copied
If we upgrade to Acrobat Pro: is there any way to execute Preflight from command line or from plugin?
Copy link to clipboard
Copied
Yes and Yes.
Copy link to clipboard
Copied
We built Preflight Droplet and testing it with Acrobat XI Pro (Demo) .
Can you please point to SDK API to launch Preflight from plugin?
Copy link to clipboard
Copied
There is documentation in the SDK about the JS-based APIs that you can use from a plugin.
Copy link to clipboard
Copied
If you purchase a subscription for Acrobat DC – instead of a perpetual license- then there is no EOL since you are paying for ongoing support as part of your subscription.