COM / OLE Adobe Acrobat Reader

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...




[-o< Please help me [-o<
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...





[-o< Please help me [-o<
0
Comments
-
I forget to say that I found it's the CREATE(adobe) method which makes the crash. ](*,)0
-
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.0
-
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? :-k0 -
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!0 -
I forget to say that with Navision V4, it doesn't crashAdobe 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.0 -
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<0 -
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...0 -
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? #-o0 -
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)0 -
Ah ok, now I can understand.
Is there any other solution to this problem? :x0 -
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:)0 -
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.0 -
Answering five years laters is fun0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions