Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Print an pdf document directy from Forms12c with Adobe DDE

FCHMay 31 2017 — edited Jun 6 2017

Hi All,

I have a task to investigate a possible direct printing with an Adobe DDE-call from Forms12c. I know there is a JAVA solution that works and I know there is a OLE solution if ADOBE is licensed.

The DDE solution should still work for the free ADOBE Reader. The Job here is to find out if this could be an alternative. Has anyone a solution for this?

My example starts Acrobat but always fails with "MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');"

I am using local parameters

[HKEY_CLASSES_ROOT\acrobat\shell\open\command]

[HKEY_CLASSES_ROOT\acrobat\shell\open\ddeexec]

And I took a solution from Oracle Support and modfied it with ADOBE commands.

I want to open the PDF document, print it, and Close it again with DDE commands.

-----------------------------------------------------------------------------------------------------------------------

DECLARE
    x number(1) := 0;
     appid            PLS_INTEGER;
     convid           PLS_INTEGER;
     docid            PLS_INTEGER;

/* Begin trigger DDE sample */
BEGIN

/* Start Acrobat */
/* This line assumes that Excel is in the directory e:\msoffice\excel */
   APPID := DDE.APP_BEGIN('"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"',DDE.APP_MODE_NORMAL);
   --dbms_lock.sleep(2);
   synchronize;
   convid := DDE.INITIATE('AcroViewR10','control');
   --dbms_lock.sleep(2);

   DDE.Execute(ConvID,'[DocOpen(C:\temp\test.pdf)]',100000);
   DDE.EXECUTE(convid,'[APPExit()]', 100000);

   DDE.TERMINATE(docid);
   DDE.TERMINATE(convid);
   DDE.APP_END(appid);

/* Handle exceptions */
EXCEPTION
  WHEN DDE.DDE_APP_FAILURE THEN
    MESSAGE('WINDOWS APPLICATION CANNOT START.');
  WHEN DDE.DDE_PARAM_ERR THEN
    MESSAGE('A NULL VALUE WAS PASSED TO DDE');
  WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
    MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');
  WHEN DDE.DMLERR_NOTPROCESSED THEN
    MESSAGE('A TRANSACTION FAILED');

/* End of trigger */
END;

This post has been answered by Michael Ferrante-Oracle on Jun 4 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2017
Added on May 31 2017
2 comments
910 views