× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Vern,
I was not aware that *USRASCII can be interpreted as anything like PDF,
TXT etc.. Scott Klement explained this well. We have a spool file that
includes BARCODES generated by a 3rd party application called Mark
Magic. This spool file is of type *USRASCII. The users send this file to
a barcode printer. The printed reports are then faxed all over the
company for pricing. Our requirement is now to send the spool file via
PDF or other formats through email to a bunch of users. The reason I
wondered about control characters was because we already use Peter
Clifford's spool to PDF utility that copies spool file using the CPYSPLF
command. The utility parses the spool file, appends PDF specific headers
and sends the resultant file via email. Since I couldn't use CPYSPLF on
a *USRASCII file, I used the spool API QSPGESTP to copy the contents of
the spool to a PF. I then bypassed the CPYSPLF command in the utility to
append PDF header and trailers in the resultant PF. I ran into problems
here because the utility looks for line and page spacing based on the
control characters in the spool (ideally the CPYSPLF command would have
appended the control characters to the PF). I could comment those
specific lines but all I get is a blank PDF.

Thanks,
Prakash

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: March 5, 2008 10:23 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Convert *USRASCII spool file to PDF

Prakash

It would be extremely unusual to have control characters in a *USERASCII
spooled file - the name says it all - it is an ASCII kind of thing, not
EBCDIC. Most of the time, I believe, the contents of a *USERASCII are
already some kind of DOS file or Windows file, such as a PDF or PCL that
is ready to print on an HP=compatible printer.

So what you are asking for does not make much sense. Can you say more?
What do you get in the PF when you extract the contents? Is there a
marker at the start, such as "PDF 1.0"? What product created the spooled
file in the first place?

And CPYSPLF can't copy a *USERASCII spooled file that I know of. Here is
a message received after running CPYSPLF against a *USERASCII spooled
file on our machine

Message ID . . . . . . : CPF3429 Severity . . . . . . . : 30
Message type . . . . . : Diagnostic
Date sent . . . . . . : 03/05/08 Time sent . . . . . . :
21:17:23

Message . . . . : File RPTSAMPLE number 47 cannot be displayed,
copied, or
sent.
Cause . . . . . : File RPTSAMPLE number 47 job
015283/VERN/QPADEV000B cannot be displayed, copied, or sent. Reason
code is 3. If the member option (MBROPT) parameter is specified as
*REPLACE on the Copy Spooled File (CPYSPLF) command, the TOFILE was
cleared.
1 - The file has no records.
2 - The file contains only blank records, graphics, bar codes, or
intelligent printer data stream (IPDS) transparent data.
3 - The file contains only ASCII data intended for a personal
computer printer.

Notice that it was reason code 3 - and note that it speaks of a personal
computer.

<verndor response>
By the way, we have several utility applications that work with spooled
files and convert between several formats. If interested, please email
sales@xxxxxxxxxxxxxxx or call in the US 888.RJS.SOFT - and check out our
web site at www.rjssoftware.com </verndor response>

Regards
Vern

At 05:07 PM 3/5/2008, you wrote:

Hello,
I'm trying to convert a *USRASCII spool file to PDF. I used the spool

file APIs (QSPGESTP, QSPOPNSP, QSPCLOSP) to write the spool data into a

PF. I don't want to create a new spool because of security restrictions

in my work. The problem I now have is how to append control characters
of the spool file into the PF (basically I want to mimic CPYSPLF with
CTLCHAR(*PRTCTL) so that I can feed this PF to a utility that creates a

PDF. Is there a way the spool APIs give me the control characters too?

Thanks in advance,
Prakash
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.