Skip to main content
lmeller
Participating Frequently
June 26, 2017
Question

garbled prints from SDK 11 plugin if PDFs include CID fonts

  • June 26, 2017
  • 2 replies
  • 2908 views

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.

This topic has been closed for replies.

2 replies

Legend
July 7, 2017

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.

lmeller
lmellerAuthor
Participating Frequently
July 7, 2017

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?

lmeller
lmellerAuthor
Participating Frequently
July 7, 2017

If we upgrade to Acrobat Pro: is there any way to execute Preflight from command line or from plugin?

lrosenth
Adobe Employee
Adobe Employee
June 26, 2017

Without knowing EXACTLY what your plugin does (in terms of the API calls used and the parameters to them) – no idea…

lmeller
lmellerAuthor
Participating Frequently
June 27, 2017

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;
}

lrosenth
Adobe Employee
Adobe Employee
June 27, 2017

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?