opening pdf file
Brian K. White
brian at aljex.com
Mon Jan 24 11:18:19 PST 2005
----- Original Message -----
From: "Joe Hirschman" <joe at aljex.com>
To: <filepro-list at seaslug.org>
Sent: Monday, January 24, 2005 11:46 AM
Subject: opening pdf file
We are trying to open output as a pdf in adobe but get the following error.
Adobe Reader could not open 2754.pdf because it is either not a supported
file type or because the file has been corrupted (for example, it was send
as an email attachment and wasn't correctly decoded).
This is the process we are running
Then:
110 ------- - - - - - - - - - - - - - - - -
ø If:
Then: ex="/ptmp/"{rand(){".pdf"
111 ------- - - - - - - - - - - - - - - - -
ø If: ' start building system command
Then: es = "umask 0 ;cd /htdocs"
112 ------- - - - - - - - - - - - - - - - -
ø If: ' write pdf file /ptmp
Then: es = es < ";unpcl" < et < "|ibm2ascii |pipe2csv >"<ex{""
113 ------- - - - - - - - - - - - - - - - -
ø If: ' pop up web browser
Then: es = es < ";winstart http://"{getenv("SRVIP"){ex{""
114 ------- - - - -
ø If:
Then: system es
115 ------- - - - -
-----------------------------------
You didn't create a pdf file with those commands.
You created a plain text and named it like a pdf but adobe can't read plain
text.
To make a pdf you need to:
a) Don't strip out the PCL codes (no unpcl or ibm2ascii)
b) run pcl2pdf
c) the pipe2csv is a crude horrible hack I should have never written to make
excel files and has nothing to do with pdf's
Like so:
Lines 111 and 112 are the ones that changed...
Then:
110 ------- - - - - - - - - - - - - - - - -
ø If:
Then: ex="/ptmp/"{rand(){".pdf"
111 ------- - - - - - - - - - - - - - - - -
ø If: ' start building system command
Then: es = "umask 0"
112 ------- - - - - - - - - - - - - - - - -
ø If: ' write pdf file /ptmp
Then: es = es < ";pcl2pdf" < et < ex
113 ------- - - - - - - - - - - - - - - - -
ø If: ' pop up web browser
Then: es = es < ";winstart http://"{getenv("SRVIP"){ex{""
114 ------- - - - -
ø If:
Then: system es
115 ------- - - - -
For the rest of you, "et" is a print file containing pcl that was generated
before entering this call table.
This table offers several print/fax/email/view options and it retains the et
file and treats it as a source that it repeatedly reads and pipes into other
programs or translates into other formats. Always any translated versions
are generated as new files in /ptmp. "ex"
/ptmp is a self cleaning tmp directory where anything you dump in there will
go away all by itself 2 minutes after you create it or 2 minutes after you
last modify it actually.
It has the same relative path from root / and in htdocs, so you can have a
single variable that has /ptmp/something and it works both in system
commands at the OS level and when tacked on to a url. The report or fome
command that generated et never has to get run more than once.
The call table (actually a system rclerk...) is kind of what -pq tries to be
but can't.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
More information about the Filepro-list
mailing list