Author Topic: Help transforming INF to PDF  (Read 6305 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Help transforming INF to PDF
« on: April 09, 2015, 06:42:04 pm »
Hi

I'm giving up for the moment to install CUPS to try to convert some INF to PDF. I will try it some months later when I have more time, right now I can't.

This is why I'm requesting some help to convert this INFs files from the IBM OS/2 toolkit to PDF. This is because I want to ask permission to be distribuited it and include some content on the EDM/2 Wiki, and INF is not a readable format for them (the layers) and I don't want to send it on HTML because it will be a mess.

I have the OS2TK45 docs files dated (2001/04/10). I guess those are the latest ones.

Please contact me by email if you can help me out transforming this files.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Sergey Posokhov

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 6
  • Posts: 120
    • View Profile
    • OS/2 API Research

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Help transforming INF to PDF
« Reply #2 on: April 09, 2015, 11:55:41 pm »
Thanks Sergey, but I need the latest one that I was able to find transformed to PDF:

16/10/2000  16:14           232.941 addendum.inf
04/10/2001  14:26         1.012.558 alpref.inf
04/10/2001  14:27         1.296.377 cp1.inf
04/10/2001  14:27         1.181.572 cp2.inf
04/10/2001  14:27           279.099 cp3.inf
04/10/2001  14:32           197.648 dnal1mst.inf
04/10/2001  14:32           149.374 dpil1mst.inf
04/10/2001  14:27            19.502 gpi1.inf
04/10/2001  14:27         1.196.951 gpi2.inf
04/10/2001  14:27           872.737 gpi3.inf
04/10/2001  14:28         1.087.894 gpi4.inf
04/10/2001  14:32           895.769 ipfref.inf
04/10/2001  14:28           626.544 mmapg.inf
04/10/2001  14:28           420.276 mmref1.inf
04/10/2001  14:28           921.151 mmref2.inf
04/10/2001  14:28           935.582 mmref3.inf
04/10/2001  14:28           800.265 mmsspg.inf
04/10/2001  14:32            72.642 nmake32.inf
04/10/2001  14:32            68.777 oglbase.inf
04/10/2001  14:27           473.247 open32.inf
04/10/2001  14:32           497.829 pdguide.inf
04/10/2001  14:30           673.559 pm1.inf
04/10/2001  14:30         1.271.373 pm2.inf
04/10/2001  14:30         1.351.092 pm3.inf
04/10/2001  14:30           886.668 pm4.inf
04/10/2001  14:30           504.379 pm5.inf
04/10/2001  14:32           263.658 pmbdtech.inf
04/10/2001  14:32           111.920 rc16.inf
04/10/2001  14:29           305.672 rexxpg.inf
04/10/2001  14:29         3.595.100 sg244640.inf
04/10/2001  14:31           655.236 somguide.inf
04/10/2001  14:31           815.550 somref.inf
04/10/2001  14:32           995.548 srvfpgr.inf
16/10/2000  16:27           582.952 tcppr.inf
05/01/2004  13:54           569.018 toolsref.inf
04/10/2001  14:31           212.771 usetlkt.inf
04/10/2001  14:32           185.183 winsoc11.inf
04/10/2001  14:31           362.010 wps1.inf
04/10/2001  14:31         1.183.465 wps2.inf
04/10/2001  14:31           311.799 wps3.inf
04/10/2001  14:31           883.362 wpsguide.inf
04/10/2001  14:32           775.323 xpg4ref.inf

Those are the ones from the OS/2 Toolkit 4.5.
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: Help transforming INF to PDF
« Reply #3 on: April 10, 2015, 04:02:32 am »
I thought there was a couple of programs to do this but I can't find them now. Options, convert to HTML and then to PDF. http://hobbes.nmsu.edu/download/pub/os2/util/convert/i2htm091.zip, http://hobbes.nmsu.edu/download/pub/os2/util/convert/htmltopdf-rel2.zip or use Firefox/SeaMonkey to print the HTML to PDF (print to file with a PDF extension). Or use one of the print to PDF drivers to print from NewView. Might be more choices if you have access to Linux, Windows or such where better tools are available such as DocView.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Help transforming INF to PDF
« Reply #4 on: April 10, 2015, 12:06:08 pm »
Hi Dave

I'm going to try the html2pdf.

I'm not being able to make ghostcript to work fine with the PDF printers to make a direct transformation from Newview to PDF. And on other platform (for what I tried) DocView is very limited, it does not allow to print , save on other format or copy the text.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Alex Taylor

  • Sr. Member
  • ****
  • Thank You
  • -Given: 10
  • -Receive: 17
  • Posts: 274
    • View Profile
Re: Help transforming INF to PDF
« Reply #5 on: April 11, 2015, 03:38:59 pm »
I'm not being able to make ghostcript to work fine with the PDF printers to make a direct transformation from Newview to PDF. And on other platform (for what I tried) DocView is very limited, it does not allow to print , save on other format or copy the text.

You could use a 2-step process: use Postscript printer on FILE: to print to a Postscript file from NewView.  Then use Ghostscript's lib\ps2pdf.cmd to convert the .PS file to PDF from the command line.  (This probably requires the gsx.yy\bin directory on both PATH and LIBPATH, unless you run the script itself from there.)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Help transforming INF to PDF
« Reply #6 on: April 12, 2015, 12:10:09 am »
Thanks Alex. I will give it try.
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Help transforming INF to PDF
« Reply #7 on: April 12, 2015, 12:18:07 am »
uhm...

Quote
[E:\OS2TK45\BOOK]ps2pdf addendum.ps
     1 +++   ??????parse arg params??gs = '@gsos2'?inext = '.ps'?outext = '.pdf'
??if params = '' then call usage??options = ''???i = 1?param = word(params, i)?d
o while substr(param, 1, 1) = '-'? options = options param? i = i + 1? param = w
ord(params, i)?end??infile = param?if infile = '' then call usage?outfile = word
(params, i + 1)?if outfile = '' then do? outfile = infile''outext? infile = infi
le''inext?end??gs options '-q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -s
OutputFile='outfile options '-c save pop -f' infile?exit??usage : ?say 'Usage: p
s2pdf [options...] input[.ps output.pdf]'?exit?;
REX0013: Error 13 running C:\programs\gs\gs9.15\lib\ps2pdf.cmd, line 1:
Invalid character in program
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Help transforming INF to PDF
« Reply #8 on: April 12, 2015, 12:26:31 am »
ok, I think I found a working way to make a PDF from .ps with ghostscript 9.15 and ePDF.

I will try that.
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Paul Smedley

  • Sr. Member
  • ****
  • Thank You
  • -Given: 12
  • -Receive: 54
  • Posts: 474
    • View Profile
Re: Help transforming INF to PDF
« Reply #9 on: April 12, 2015, 01:34:18 am »
Hey Martin,

ok, I think I found a working way to make a PDF from .ps with ghostscript 9.15 and ePDF.

I will try that.

FYI, I have Ghostscript 9.16 built - I just need to get around to packaging and uploading it :)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: Help transforming INF to PDF
« Reply #10 on: April 12, 2015, 05:03:00 am »
uhm...

Quote
[E:\OS2TK45\BOOK]ps2pdf addendum.ps
     1 +++   ??????parse arg params??gs = '@gsos2'?inext = '.ps'?outext = '.pdf'
??if params = '' then call usage??options = ''???i = 1?param = word(params, i)?d
o while substr(param, 1, 1) = '-'? options = options param? i = i + 1? param = w
ord(params, i)?end??infile = param?if infile = '' then call usage?outfile = word
(params, i + 1)?if outfile = '' then do? outfile = infile''outext? infile = infi
le''inext?end??gs options '-q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -s
OutputFile='outfile options '-c save pop -f' infile?exit??usage : ?say 'Usage: p
s2pdf [options...] input[.ps output.pdf]'?exit?;
REX0013: Error 13 running C:\programs\gs\gs9.15\lib\ps2pdf.cmd, line 1:
Invalid character in program

Looks like a line ending problem where the REXX script has unix line endings. Simplest is to load it into the system editor and save it (untested with the eCS editor) or run unix2dos on it.

Andreas Schnellbacher

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 24
  • Posts: 440
    • View Profile
Re: Help transforming INF to PDF
« Reply #11 on: April 12, 2015, 11:16:11 am »
Simplest is to load it into the system editor and save it (untested with the eCS editor) or run unix2dos on it.
Or use EPM:
  • Load the file
  • Press Ctrl+I or Esc to open the command dialog
  • Type save /o and press Ok to save it with CRLF line endings.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Help transforming INF to PDF
« Reply #12 on: April 12, 2015, 02:34:43 pm »
Hi Andreas.

The EPM did the trick with ps2pdf.cmd.

But I still get an error with Ghostscipt 9.15.

Quote
[E:\OS2TK45\BOOK\PS]ps2pdf addendum.ps addendum.pdf

*** Warning: GenericResourceDir doesn't point to a valid resource directory.
               the -sGenericResourceDir=... option can be used to set this.

Error: /invalidfont in /findfont
Operand stack:
   150   Helvetica
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1935   1   3   %oparray_pop   1934   1   3   %oparray_
pop   1918   1   3   %oparray_pop   1804   1   3   %oparray_pop   --nostringval-
-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv
al--   2   %stopped_push   --nostringval--   --nostringval--   1887   2   4   %o
parray_pop
Dictionary stack:
   --dict:1178/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--   --dict:55
/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 3692
GPL Ghostscript 9.15: Unrecoverable error, exit code 1

Now I'm reading about "-sGenericResourceDir=".
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 405
  • -Receive: 79
  • Posts: 2402
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Help transforming INF to PDF
« Reply #13 on: April 12, 2015, 03:16:02 pm »
Maybe I'm loosing some basic information on how to configure ghostscript on OS/2.

Is there any documentation available. I followed the readme.os2 instructions on ghostscript but I think I'm missing more.
I had only included the \bin and \lib on path and libpath as extra.

Any recommendations?
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2168
    • View Profile
Re: Help transforming INF to PDF
« Reply #14 on: April 12, 2015, 05:37:06 pm »
Haven't tried gs9.15 but with gs8.00 I use this cmd to invoke it, note that the device=os2pm no longer works with 9.x as the driver is no longer there. Gs is installed in f;\utils\gs8.00.

Code: [Select]
@f:\utils\gs\gs8.00\bin\gsos2.exe -If:/utils/gs;f:/utils/gs/fonts;n:/psfonts -sDEVICE=os2pm -dBitsPerPixel=8 -sPAPERSIZE=a4 %1 %2 %3 %4 %5 %6 %7 %8

The important part to fix your error is probably including psfonts.