COM / OLE Adobe Acrobat Reader

GRUXXKI
GRUXXKI Member Posts: 12
Hello everybody,

I'm new in C/SIDE developpement, and I'm looking for the things that Navision is able to do.

I'm trying to print a PDF by using OLE. So I've created an Automation DataType wich subtype is 'Adobe Acrobat 7.0 Browser Control Type Library 1.0'.AcroPDF

So to make simple I've made this code:


chemin := 'C:\file_to_print.pdf';

CREATE(adobe);

MESSAGE('Vous allez imprimer: "%1"',chemin);

adobe.LoadFile(chemin);

adobe.Print;

But when I launch it, I've a windows error: "Microsoft Business Solutions-Navision has encountered a problem... blablablablabla ... ReStart Navision... :cry::cry::cry::cry::cry:


[-o< Please help me [-o<

Comments

  • GRUXXKI
    GRUXXKI Member Posts: 12
    I forget to say that I found it's the CREATE(adobe) method which makes the crash. ](*,)
  • facade
    facade Member Posts: 57
    You should probaly use system.webbrowser for pointing adobe - now it looks as tho you are trying to open it up in Navision, which of course is impossible.
  • GRUXXKI
    GRUXXKI Member Posts: 12
    it looks as tho you are trying to open it up in Navision, which of course is impossible.

    Why impossible??? It's possible to open Word, Excel, why not Acrobat Reader? :-k
  • GRUXXKI
    GRUXXKI Member Posts: 12
    So... I will answer by myself =D>

    I found what's the problem...

    The free version of acrobat, acrobat reader instal automation server, but they don't work!!! If I want it to work, I have to buy a full version =P~

    http://support.adobe.com/devsup/devsup.nsf/docs/50709.htm

    But it shoulds works!
  • watung
    watung Member Posts: 29
    GRUXXKI wrote:
    The free version of acrobat, acrobat reader instal automation server, but they don't work!!! If I want it to work, I have to buy a full version =P~

    Refuse to work by making other program crashed?? [-(
  • GRUXXKI
    GRUXXKI Member Posts: 12
    I forget to say that with Navision V4, it doesn't crash :)
    Adobe wrote:
    Summary
    Reader does not support OLE. If you are developing in Acrobat, check that you are creating objects properly.

    Issue
    I wasn't able to use the objects in the PDF.tlb file despite them being visible in VB. When the program is compiled the error "Can't create Object" is displayed.
    Solution
    Unfortunately, Acrobat Reader does not support OLE automation, as stated in the Interapplication Communication Overview located in the Acrobat SDK. Therefore, your options are to upgrade to full version of Acrobat, where OLE is supported.
  • kneoATwork
    kneoATwork Member Posts: 19
    Do you use any patched version of Navision? :-k

    Because if I try to use Acrobat Reader 7.0 Automation with Navision W4.00 it crashes always. This is the code I use:

    Name DataType Subtype Length
    auto Automation 'Adobe Acrobat 7.0 Browser Control Type Library 1.0'.AcroPDF

    IF ISCLEAR(auto) THEN
    CREATE(auto);
    auto.LoadFile('c:\mod.pdf');
    auto.Print;

    Can you help me? [-o<
  • GRUXXKI
    GRUXXKI Member Posts: 12
    Hello!

    The matter is'nt the code, but the fact that you need to have a writer edition of Adobe, because in the free version the automations are not enabled... #-o

    that's all...
  • kneoATwork
    kneoATwork Member Posts: 19
    Hello!

    The matter is'nt the code, but the fact that you need to have a writer edition of Adobe, because in the free version the automations are not enabled...

    that's all...

    But you said:
    I forget to say that with Navision V4, it doesn't crash

    Can you explain me, please? #-o
  • GRUXXKI
    GRUXXKI Member Posts: 12
    Yes, when I say it does'nt crash, it's just that my computer stay stable, when with an other Navision it crash.
    But if you want to use Adobe Automation, you will need to buy it, even if you just want to print a pdf on a printer. :?

    Thank you Adobe ](*,)



    (excuse my english, but my italian is twice poor)
  • kneoATwork
    kneoATwork Member Posts: 19
    Ah ok, now I can understand.

    Is there any other solution to this problem? :x
  • GRUXXKI
    GRUXXKI Member Posts: 12
    Well, one solutions is to print with command line

    C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe /p /h test.pdf


    But pay attention to the fact that Navision isn't a good shell manager, so when you do it, the encapsulation(don't know if it means something in english... =P~ ) is'nt well down, and adobe won't stop himself.

    An other solution is to make a short program with a real language as C++, Java or C#, and to launch adobe with it, and kill it when the print is done.

    I hope it will help you. O:)
  • vladimirp
    vladimirp Member Posts: 1
    hi, printing with adobe have several problems, not every user have adobe reader, adobe wont close after printing, and so on.
    You can check CLPrint from http://www.commandlinepdf.com CLPrint have many options for automation pdf print and pdf converting to images.
  • GRUXXKI
    GRUXXKI Member Posts: 12
    Answering five years laters is fun :D