ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RTF to readable spool file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RTF to readable spool file

    Hi guys

    Hope everyone is fit as fiddle. I have a RTF document in IFS( QDLS). This RTF has my company logo embedded in it. We have WAF and IWP viewer installed in our AS/400 and Windows. We need to view the RTF document through IWP. But this RTF is not properly viewed through IWP. The text part is displayed properly but the logo doesnt appear properly(It consists of junk characters).

    I need to convert RTF document to MOCA format so that it is viewed properly through IWP(Image Workstation Plus Viewer).

    There is WAF API which converts spool file to MOCA and overlays the Logo automatically and imports to CASE(a directory in IFS) where it is viewed properly through IWP.


    For this I need to convert my RTF (without LOgo. I have removed the embedded Logo coz it is automatically overlaid when I convert the spool file to MOCA format) to a spool file.


    I tried to convert my RTF to spool file as follows:


    1) I used CPYFRMIMPF to convert the RTF file to a database file. I have already created the database file with recordlength of 132.

    2) Then I used CPYF file(qsysprt) to get the spool file.

    But to my dismay I got the Spool file with the junk characters like below:


    \rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfl och0\stshfhich0\sts
    \f36\fscript\fcharset0\fprq2{\*\panose 00000000000000000000}Comic San
    \f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\froman\fchar
    \f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f397\fs
    \f401\fscript\fcharset162\fprq2 Comic Sans MS Tur;}{\f404\fscript\fch
    red255\green255\blue0;\red255\green255\blue255;\re d0\green0\blue128;\
    ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustri ght\rin0\lin0\it


    and inbetween the text of my RTF.



    Is there any way to convert the RTF to a readable Spool. I mean i need only text that is in the RTF document. So that i can import the spool file to case and view through IWP viewer.



    Is there any AS/400 tool or java api or java tool which converts this RTF document to MOCA or TIFF or JPEG format???


    Your help will be graetly appreciated.

    Plz help me. I am really struck at this point. Thanks a lot in advance.


    Have a nice day

    Waiting eagerly for your suggestions and help.


    Thanks and Regards.

    Nand.

  • #2
    Re: RTF to readable spool file

    The RTF format is a tag based format not overly differnt to XML. The tags all begin with "\". Just open the .rtf in an ASCII text viewer to see. The images are also in this tag format.

    The are numerous specifications around, here's one...

    http://www.biblioscape.com/rtf15_spec.htm

    The images are held within a "\PICT" tag in what I presume is base64 encoding but I'm not sure and I can't be bothered to read the spec.

    You could read the spec a write some thing to parse and extract what you want.

    Or....there's plenty of people who have already done this, try this google search and see what you can find....

    http://www.google.co.uk/search?hl=en...ASCII%22&meta=

    Comment

    Working...
    X