PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Lawrence_Leavell on August 21, 2019, 04:10:33 PM

Title: '*X' mnemonic
Post by: Lawrence_Leavell on August 21, 2019, 04:10:33 PM
I have a program on the Linux server which creates C:/TEMP/FILENAME.PDF on the workstation.
This works well
OPEN(PRNT)"[wdx]*PDF*;FILE="+REPORT_NAME$+";ORIENTATION="+ORIENTATION$+";Overwrite"

Next, I wish to display this file.
PRINT (PRNT)'*X'="[WDX]SHOW_PDF;"+REPORT_NAME$
====
However, I get an err=49.  What is wrong with this syntax?
===
0010 REM "SHOW_PDF" - Display Client PDF File on Client
0020 REM "lxl/Tesla Systems/20190821
0030 REM
0040 ENTER FILENAME$
0050 IF %WDX$="" THEN MSGBOX "Must be Using Windx to run this program.",OK$; EX
0050:IT
0060 SYSTEM_HELP OPEN WAIT SUB(FILENAME$,"[WDX]","")
0070 EXIT


Title: Re: '*X' mnemonic
Post by: Mike King on August 21, 2019, 05:03:05 PM
Lawrence

A few things are wrong;


BTW: If all you are trying to do is display a PDF file why not just issue:

OPEN (PRINT) "*PDF*;View"

Let PxPlus take care of the rest.  It will create the PDF file, send it to the workstation and invoke whatever PDF viewer the workstation has installed.  When done the PDF file will be deleted however the user can save it using the viewers functions.

If your images are on the workstation or you want to use the fonts that exist on the workstation and not the server then you can just prefix the *PDF* with [LCL] or [WDX].

Title: Re: '*X' mnemonic
Post by: Lawrence_Leavell on August 22, 2019, 06:23:01 PM
The customer has ordered:
1. Create the output PDF on the PC using a specific name.
2. Display the PDF on the PC PDF Viewer.

What I did was create the PDF on the Linux system and copy it to the PC.
Next, I have tried:
MNEMONIC (CH1)'*R'="SYSTEM_HELP OPEN WAIT "+OUTPUT$
but this does not work, complaining that the file is open.
Is there some other way to do this?
Title: Re: '*X' mnemonic
Post by: James Zukowski on August 22, 2019, 06:59:07 PM
We've got a similar situation, and used this:

Code: [Select]
Options$="FILE=<Filename>.pdf"
Open (Chan,opt=Options$,err=Oops)Wdx$+"*PDF*;View"
.
Print(Chan)...
.
Close(Chan)

As long as you include the ".pdf" in there, it should be fine. Also, since WDX$ is used for opening *PDF*, you don't need it on the filename.