# Open pdf file from Natural

**URL:** <https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [October 1, 2007, 12:08pm UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455 "2007-10-01T12:08:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Claus](https://techcommunity.softwareag.com/u/Claus)\
**Post date:** [October 1, 2007, 12:08pm UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455/1 "2007-10-01T12:08:43Z")

</div>

Anybody tried to open a PDF file from Natural ?

I have the following code :

0030 DEFINE DATA  
0040 LOCAL  
0050 1 #VIEWER HANDLE OF OBJECT  
0060 1 RC (I4)  
0070 1 PARM (A) DYNAMIC  
0080 1 OBJ-CLASS (A35) CONST \<‘AcroPDF.PDF’\>  
0090 1 SVAR (L)  
0100 END-DEFINE  
0110  
0120 CREATE OBJECT #VIEWER OF CLASS OBJ-CLASS GIVING RC  
0130  
0140 IF RC NE 0  
0150 ESCAPE ROUTINE  
0160 END-IF  
0170  
0180 PARM := ‘C:\temp\ud.pdf’  
0190 \*\* Load  
0200 SEND ‘LoadFile’ TO #VIEWER  
0210 WITH PARM  
0220 RETURN SVAR  
0230  
0240 write SVAR  
0250  
0260 #VIEWER := NULL-HANDLE  
0270 END

I can see AcroRd32.exe in my taskmaneger, but the LoadFile returns false, and nothings happens.

Anybody with an idea ?

Thanks Claus

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [October 1, 2007, 4:18pm UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455/2 "2007-10-01T16:18:24Z")

</div>

Hi Claus;

I use usr1052.

define data local  
1 usr1052l  
2 os-command (a253)  
2 response (i4)  
end-define  
\*  
move ‘c:\program files\adobe\acrobat 5.0\reader\acrord32.exe’ to os-command  
callnat ‘usr1052n’ usr1052l  
end

to open a pdf, rather than just start acrobat, add a reference to os-command  
e.g. c:\mypdf,pdf

steve

---

<div class="post-metadata">

**Author:** ![Claus](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Claus](https://techcommunity.softwareag.com/u/Claus)\
**Post date:** [October 1, 2007, 5:40pm UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455/3 "2007-10-01T17:40:33Z")

</div>

Hi Steve,

I’m not so happy about the solution with the full ‘path’ to AcroRd32.exe, because I know that people have different versions, and perhaps also different paths to this.

But I did find a solution that works :

0080 MOVE ‘CMD.EXE /C C:\TEMP\UD.PDF ASYNCH’ TO OS-COMMAND  
0090 CALLNAT ‘USR1052N’ USR1052L

I use the ASYNCH because the user should be able to continue working in Natural.

The only ‘problem’ is that I get a CMD window, but it closes when I exit the viewer, so I think I can live with it.

Thanks for the reply, it was even simpler than my solution.

Claus

---

<div class="post-metadata">

**Author:** ![Richard](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Richard](https://techcommunity.softwareag.com/u/Richard)\
**Post date:** [August 1, 2008, 8:36pm UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455/4 "2008-08-01T20:36:59Z")

</div>

Where does one find USR1052?

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [August 1, 2008, 11:05pm UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455/5 "2008-08-01T23:05:02Z")

</div>

There is a wonderful library called SYSEXT, that has several hundred or so, “utilities”.

Some shops prevent users from logging on to SYSEXT. So, try LOGON SYSEXT. If you get a security error message, or if the logon simply doesn’t work, you are in one such shop. The solution would be to explain to the DBA, or your manager, that you require access to USR1052. They may simply move the routine to your library.

Once you get to SYSEXT (assuming you can), run the program called MENU.

steve

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [August 2, 2008, 12:38am UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455/6 "2008-08-02T00:38:54Z")

</div>

Natural Studio provides a plug-in to SYSEXT. I’ve attached a Word document containing the toolbar icon. If you can’t find the SYSEXT Utility toolbar or icon, click Tools → Configuration Tools → Plug-in Manager. On the SYSEXT Utility context menu (right-click SYSEXT Utility) click Activate.  
[SYSEXT icon.doc](https://techcommunity.softwareag.com/uploads/short-url/A3G495lutEBcIVx1kZ0TxxuVk2.doc) (23.5 KB)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:48pm UTC](https://techcommunity.softwareag.com/t/open-pdf-file-from-natural/75455/7 "2021-04-02T14:48:47Z")

</div>


