Mac OS 9 Lives

Mac OS 9 Discussion => Software => Topic started by: Mat on December 09, 2015, 11:50:52 AM

Title: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on December 09, 2015, 11:50:52 AM
As we are having some developers onboard now, I like to put a request here. It may be a easy solution, just needing a weekend for an experianced developers to make our Mac OS 9 computers a lot more usable for everyday tasks.

Please could somebody with codewarrior knowledge have a look!

One of the real problems we are facing is that Acrobat Reader 5.05 has come to age and is not able to render/display all modern PDF documents. Especially when it comes to  1.7 or 2.0 versions, or some 1.5 versions with unprintable content.

As there was always a Mac Ghostscript outside, it may be that it is totally simple for a developer, to push us to the present again and enable us to view all PDF documents. At least a huge improvement over Acrobat Reader should be easily possible. So here is the whole story:

There is MacGSView a viewer for PDF and PS files, distributed under the "Aladdin Free Public License". It is working well and additionally has a nice interface.

You can grab it here (plus the sources):
http://ftp.ntua.gr/mirror/ghost/aladdin/gs601/mac/test/

This viewer needs the "MacGS shhlib" to compute the PDFs.
You can get those up to date GhostScript libs at the sourceforge site:

http://sourceforge.net/projects/ghostscript/files/

There is the former AFPL Ghostscript and the recent GPL Ghostscript. AFPL Ghostscript always had binaries (and sources) for Mac OS 9. The latest version of this "MacGS shhlib" (which is needed so that the above "MacGSView 2.0b3" can display PDFs) from AFPL Ghostscript is the version 8.51 from the year 2005.
http://sourceforge.net/projects/ghostscript/files/AFPL%20Ghostscript/8.51/
Sadly there is some problem and it doesnt work correctly.

Tha latest version I could use successfully is the 8.00 from 2002
http://sourceforge.net/projects/ghostscript/files/AFPL%20Ghostscript/8.00/

Sadly this is no real improvement over Acrobat reader.

I am quite sure that some codewarrior wizard could recompile the 8.51 from 2005 and bring us a huge step foreward immediatly. Perhaps it is even possible that the recent GPL Ghostscript is usable with the MacGS view easily? I cannot tell if huge porting would be needed or if it is as well a simple recompilation?

Can some developer please investigate and help !?



Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on December 09, 2015, 12:25:39 PM
There is the former AFPL Ghostscript and the recent GPL Ghostscript. AFPL Ghostscript always had binaries (and sources) for Mac OS 9. The latest version of this "MacGS shhlib" (which is needed so that the above "MacGSView 2.0b3" can display PDFs) from AFPL Ghostscript is the version 8.51 from the year 2005.
http://sourceforge.net/projects/ghostscript/files/AFPL%20Ghostscript/8.51/
Sadly there is some problem and it doesnt work correctly.

If there are issues and problems in 8.51 recompilation will not fix those.  They would need to be fixed or you would still be in the same spot.  Someone with a good knowledge of the source base of Ghostscript (regardless of platform) could probably patch it quicker than anyone else.  So I'm not sure it would be a trivial task or not.  I might have some time next week or after the 1st of the new year to take a look at it though.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on December 09, 2015, 12:38:16 PM
If there are issues and problems in 8.51 recompilation will not fix those.
The issue is 8.51 is simply not found by MacGSView. To me it looks the binary is damaged. That´s why I am speculating that a recompilation might solve the problem.

So I'm not sure it would be a trivial task or not.
But you are somebody who could find it out ;)
I have no idea, perhaps it is complicated and needs heavy rework, but perhaps it is a trivial task. I am sure you can quickly get an overview and tell us more.

I might have some time next week or after the 1st of the new year to take a look at it though.
That woudl be absolutely great!
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on December 11, 2015, 01:39:49 AM
To specify the problems: MacGSView needs that "GhostScriptLib PPC" from AFPL GhostScrip inside the System Extensions. As said the version 8.00 is working well. The version 8.51 contains as well a carbonized lib. Both are "not found" as soon as you try to open any file with MacGSView.
Additionally the lib package macgs-851-shlib contains a very simple GS viewer called "gsclient" this one is crashing the entire Mac immediatly if used instead of MacGSView.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on January 24, 2016, 01:31:11 AM
Wanted to push this thread again, so perhaps nanopico or somebody else could have a look.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on January 25, 2016, 06:30:01 AM
Sorry I haven't gotten to look into this yet.  I've been involved in a nightmare of a project at work that pretty much sucks the life out of me the past month.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: mrhappy on January 25, 2016, 06:45:19 AM
I HATE those 'life sucking' projects!!! ;D ;D
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on January 25, 2016, 07:15:26 AM
I HATE those 'life sucking' projects!!! ;D ;D
Unfortunately they pay the bills.
I just wish customers wouldn't ask me to create an app, only tell me a tenth of what it needs to do and then wait until deployment to tell me another tenth of what is missing and so on and so on. Make's it hard to ever get the thing finished.
Never mind it's dealing with State regulations that seem to change every 3 months.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on January 25, 2016, 11:47:25 AM
So if the exported functions and api's have not changed between 8.0 and the gpl 9.10  then  it would be possible to take the code that is platform agnostic code and put it into the 8.0, update some references and code to make it work.  So it should be possible to get the 8.53 working and possible create a 9.10 version. But please don't hold me to it. I haven't looked at the code yet.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on January 25, 2016, 07:50:07 PM
This viewer needs the "MacGS shhlib" to compute the PDFs.
You can get those up to date GhostScript libs at the sourceforge site:

http://sourceforge.net/projects/ghostscript/files/

There is the former AFPL Ghostscript and the recent GPL Ghostscript. AFPL Ghostscript always had binaries (and sources) for Mac OS 9. The latest version of this "MacGS shhlib" (which is needed so that the above "MacGSView 2.0b3" can display PDFs) from AFPL Ghostscript is the version 8.51 from the year 2005.
http://sourceforge.net/projects/ghostscript/files/AFPL%20Ghostscript/8.51/
Sadly there is some problem and it doesnt work correctly.

Tha latest version I could use successfully is the 8.00 from 2002
http://sourceforge.net/projects/ghostscript/files/AFPL%20Ghostscript/8.00/


Did you happen to download any of this?  The downloads from source forge for these all are non-existent.  They all error as not found.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on January 25, 2016, 08:46:27 PM
Did you happen to download any of this?  The downloads from source forge for these all are non-existent.  They all error as not found.
Of course! When I collected the informations again in December all of the links worked well. I can upload any of the files I linked the day after tomorrow. But it is really strange that they are "not found" now. Hopefully just a temporary SF problem!
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on January 25, 2016, 09:06:45 PM
OK, the University of Berlin has the AFPL Ghostscript completely online in working condition:

ftp://ftp.fu-berlin.de/unix/misc/ghostscript/AFPL/

Including the sources and the binaries. Structure as at Sourceforge.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on January 26, 2016, 09:44:37 AM
OK, the University of Berlin has the AFPL Ghostscript completely online in working condition:

ftp://ftp.fu-berlin.de/unix/misc/ghostscript/AFPL/

Including the sources and the binaries. Structure as at Sourceforge.

Of course sourceforge is now working.  Argh I'm not the biggest fan of source forge.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on March 06, 2016, 02:44:29 AM
Push ;)
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on March 07, 2016, 08:04:22 AM
Sorry I haven't gotten far with this.
My version of Code Warrior wasn't the correct one and I haven't had a chance to install the correct one to look at this.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on April 07, 2016, 03:41:50 PM
Do we really hae nobody onboard aside nanopico (who is doing such a great work in OS research and low level developing) who has Code Warrior up and running? I really belive that a simple recompilation might do the trick and pushes us into the present regarding pdf documents!
I hate to annoy good developers about "uninterresting" stuff, so I don´t like to bother nanopico anymore. But as well I hate to explain others that PDFx1a:2001 is the right version for printing and that printing JavaScript, ebedded videos or audio, forms and other fancy Adobe stuff is not possible at all, and that PDF 1.3 is the right version for most PDFs. ;)
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: nanopico on April 07, 2016, 09:11:47 PM
Do we really hae nobody onboard aside nanopico (who is doing such a great work in OS research and low level developing) who has Code Warrior up and running? I really belive that a simple recompilation might do the trick and pushes us into the present regarding pdf documents!
I hate to annoy good developers about "uninterresting" stuff, so I don´t like to bother nanopico anymore. But as well I hate to explain others that PDFx1a:2001 is the right version for printing and that printing JavaScript, ebedded videos or audio, forms and other fancy Adobe stuff is not possible at all, and that PDF 1.3 is the right version for most PDFs. ;)

Don't loose hope.  I'm downloading a newer code warrior and setting it up now.
I've been with out my dev setup the past couple weeks to a remodel and some other things. But I've got it back now sort of. Well enough to work on things.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: MacTron on April 08, 2016, 09:01:58 AM
Ok. GhostscriptLib 8.5.1 is working already.
It can open some PDFs that Acrobat reader 5 can't, at first. But it crash with others that Acrobat reader 5 opens correctly ...
It was just a simple spelling error.  I had to find  with Resorcerer GhostscriptLib and replace it by GhostScriptLib.
Probably this "misspelling" is on purpose ... We have to test the full compatibility with MacGSView 2.0b3.
We are going to let to nanopico bigger and complex works
... ;D  ...

Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ovalking on April 08, 2016, 11:21:20 AM
It sure would be nice to be able to open all PDFs - I reckon I can open about 80% of those I encounter. It's not clear what is special about the other 20%, but it's rather annoying.

I had not previously heard of MacGSView, but have just tried it out.
On a G3 with OS 8.6 it works with GhostScriptLib PPC 6.01 (which MacGSView comes with).
Alas it would not open a PDF downloaded from my bank - one I can't open in Acrobat Reader 4 or 5 either.

I tried GhostScriptLib PPC 8.0 & 8.51 but MacGSView complains that the library can not be opened. Confusingly it says it must be in the Extensions folder. Yet the macgs-8XX-shlib readme says it should it be in the same folder as MacGSView. Either way neither location worked for me. Another day I'll see if the behaviour is different with OS9...
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: IIO on April 08, 2016, 02:35:22 PM
as for the regular adobe pdf reader it is clear what can be special about documents: it simply wont open anything with a newer version number.

unfortunately there are too many idiots on this planet whco think it is useful to always export simple text documents using the latest version number for pdf, eps, or flash also when it is not needed at all due to the content of the file.

i am exporting an acrobat 3.x file even when i am in OSX 10.10 - and 5.x when  there are urls included. everything else is not needed in 99% of the cases.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on April 08, 2016, 04:41:13 PM
Ok. GhostscriptLib 8.5.1 is working already.
It was just a simple spelling error.  I had to find  with Resorcerer GhostscriptLib and replace it by GhostScriptLib.
Wonderful! Thats exactly what I hoped, ... (even it is a pity that it took 10 years after macgs 8.51 was released). But I am glad that my thoughs were somehow correctly.

It can open some PDFs that Acrobat reader 5 can't, at first. But it crash with others that Acrobat reader 5 opens correctly ...
Thats better than nothing! I will always try Acrobat 5.05 first, and see if it can handle the files. BTW there are some very few files that Acrobat 4 can open and 5 cannot.

We are going to let to nanopico bigger and complex works
... ;D  ...
Perhaps the 8.54 version from 2006 might be some easy work. No idea what a recent GPL Ghostscript would mean for a coder. But perhaps it is also not too much work, as it derived from AFPL? In every case a complete and modern Ghostscript would be the best!

unfortunately there are too many idiots on this planet whco think it is useful to always export simple text documents using the latest version number for pdf, eps, or flash also when it is not needed at all due to the content of the file.
Thanks! There is nothing to ad, perhaps just that this statement counts for every file format.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: MacTron on April 09, 2016, 12:04:48 PM
(even it is a pity that it took 10 years after macgs 8.51 was released)

Well, not really, it took 15 minutes  only, to find and repair the issue,  -afro-  even with MARL ( MacTron's Advanced Research Lab ) in a low activity period ... LOL
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on April 10, 2016, 01:26:32 AM
Sadly it doesn´t work on my computer. If I try to open any file from within MacGSview with the new 8.51 inside my System Extensioons folder, there is a quick flash, but no window and no rendered page appeares :-(

It is a Mac OS 9.2.2 and GhostScriptLib PPC 8.00 works perfectly.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: MacTron on April 10, 2016, 05:59:33 AM
Sadly it doesn´t work on my computer. If I try to open any file from within MacGSview with the new 8.51 inside my System Extensioons folder, there is a quick flash, but no window and no rendered page appeares :-(

It is a Mac OS 9.2.2 and GhostScriptLib PPC 8.00 works perfectly.

Did you update the "Application Support" folder stuff?
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on April 10, 2016, 11:05:59 AM
Indeed! Supid me. Putting the "lib", "Resource" and "examples" folders from the new macgs-852 folder into the MacGSView folder and 8.5.1 works without problems.
I already could open several PDFs that Acrobat 5 cannot anymore. For example the new Sonnettech manuals that are known to be incompatible ;)
And very nice as well; exporting a PDF with Ghostscript produces clean PDF 1.3 files that are again usable with Acrobat 5!

That is a huge improvement already!

Now I am going to wait for a recent Ghostscript ;)

Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: DieHard on April 11, 2016, 12:00:27 AM
From Macrton:
Quote
Well, not really, it took 15 minutes  only, to find and repair the issue,  -afro-  even with MARL ( MacTron's Advanced Research Lab ) in a low activity period ... LOL

I spit coffee all over my screen when I read that !

Thread started in Dec 2015... MARL fixed in 15 min... the usual bullshit all over again; the Mactron obviously isn't human... that avatar says it all :)
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: MacTron on April 11, 2016, 12:49:28 PM

I spit coffee all over my screen when I read that !

Thread started in Dec 2015... MARL fixed in 15 min... the usual bullshit all over again; the Mactron obviously isn't human... that avatar says it all :)

LOL

Thanks. But It was really easy. No merits.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ovalking on April 27, 2016, 12:42:52 PM
Quote
I tried GhostScriptLib PPC 8.0 & 8.51 but MacGSView complains that the library can not be opened.... Another day I'll see if the behaviour is different with OS9...

With OS9.2.2 it's different but not in my favour.
With GhostScriptLib PPC 8.51, MacGSView reports GhostScriptLib could not be found and it must be in Extns ƒ - which it was.
With GhostScriptLib PPC 8.00, MacGSView didn't complain... but couldn't open any files either (rendering error).
With GhostScriptLib PPC 6.01, MacGSView has another error: 'fopen failed in ScanPSFile', although it did at least draw a window this time. 
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 17, 2016, 12:43:33 AM
Now that I used AFPL Ghostscript 8.51 a few weeks, I can tell it is really a great help! I could open and convert a lot of PDFs that Acrobat 5.05 could not, and it enables me to not switch to other Operating Systems in several cases.

Everybody should have it on his Mac OS 9 computer. But as there are only 3 downloads at all, it seems I am the only person in the world using it. ;)

May I suggest to at least try to get it uploaded to sourceforge? Of course it would be nice to "promote" it a little bit as well. But as it can recently only be downloaded from forum memebers here that is quite impossible.

Any more ideas where to put it?
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: MacTron on May 17, 2016, 11:50:13 AM
May I suggest to at least try to get it uploaded to sourceforge? Of course it would be nice to "promote" it a little bit as well. But as it can recently only be downloaded from forum memebers here that is quite impossible.

Any more ideas where to put it?

It shouldn't be posted in sourceforge because it isn't a code debug or improved but a binary fix -technically a hack :) -
At some point it can be repackaged  with VISE or Apple installer and placed in to its own post in to the public downloads sections.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Protools5LEGuy on May 17, 2016, 12:01:18 PM

At some point it can be repackaged  with VISE or Apple installer and placed in to its own post in to the public downloads sections.

Great!
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ovalking on May 20, 2016, 07:14:36 AM
Now that I used AFPL Ghostscript 8.51 a few weeks, I can tell it is really a great help! ...

So what's the trick Mat?
I can only get MacGSView to work with GhostScriptLib PPC 6.01.

Where have you put the file "GhostScriptLib PPC" and the other items?
Did you have to delete Application Support:Ghostscript folder?
Did you have to download any fonts? (the links in the Readme do not work.)

Thanks.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 25, 2016, 06:29:59 AM

So what's the trick Mat?
I can only get MacGSView to work with GhostScriptLib PPC 6.01.

Where have you put the file "GhostScriptLib PPC" and the other items?
Did you have to delete Application Support:Ghostscript folder?
Did you have to download any fonts? (the links in the Readme do not work.)
Indeed it seems to be a little bit tricky. I have the "GhostScriptLib PPC" inside my SystemExtensions folder. Lib, Examples and Ressource-folders are inside the MacGS folder. Nothing more in the Application support. And finally I got a Fonts folder inside the Mac GS folder (with 106 "afm", "pfm" and "pbf" PS fontsfiles), but I don´t know where I got it from. It is half a year ago that I downloaded it somewhere from the links in my first posting, but I couldn´t find it anymore now.

I will start to research what I did (in my brain and at the Ghostscript servers).
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ovalking on May 27, 2016, 09:05:12 AM
Indeed it seems to be a little bit tricky. I have the "GhostScriptLib PPC" inside my SystemExtensions folder. Lib, Examples and Ressource-folders are inside the MacGS folder. Nothing more in the Application support. And finally I got a Fonts folder inside the Mac GS folder (with 106 "afm", "pfm" and "pbf" PS fontsfiles), but I don´t know where I got it from. It is half a year ago that I downloaded it somewhere from the links in my first posting, but I couldn´t find it anymore now.

Thanks for checking Mat, but still no go here.

I've got GhostScriptLib PPC, Lib, Examples and Ressource-folders in the same places as you. I've also tried them in other places without success.

I've got that fonts folder (with 106 files) in Application Support:Ghostscript. The MacGSView installer puts it there.
I moved it to the MacGS ƒ to match you but it still doesn't work.
I then removed the whole Application Support:Ghostscript ƒ (as per the macgs-851-shlib readme) but still no go.

I think I've spent long enough on this now. Back to Acrobat Reader ...
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 27, 2016, 10:57:25 AM
Thanks for checking Mat, but still no go here.
Hmm, ... I suspect some version conflict or something. Which MacGS are you using? I will try to install it at a machine that doesn´t have it at all recently.

I've got that fonts folder (with 106 files) in Application Support:Ghostscript. The MacGSView installer puts it there.
Ah, good to know. But I cannot remember that I put something out from Application Support folder. So I again suspect that you are using  another version, ...

I think I've spent long enough on this now. Back to Acrobat Reader ...
Well it is in no case a replacement for Acrobat Reader, as GhostView is extremely slow (thats what I think at Linux machines as well sometimes when it comes to more complicated stuff, like computing a bigger PDF).
So it is an addition if you got some PDFs that Acrobat cannot diplay anymore, or saving a document as clean PDF 1.3 or similar.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: MacTron on May 27, 2016, 11:43:08 AM
I think I've spent long enough on this now. Back to Acrobat Reader ...

Try this: (Fully Working Copy)
MacGSView 2 & GhostScript 8.5 (Open Modern PDFs)
http://macos9lives.com/smforum/index.php?topic=3228.msg20549#msg20549
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ovalking on May 31, 2016, 10:52:33 AM
Aha! Well done!
We have success, at least in OS9.2.2. I can now open the pdf form from my bank!
(http://62.239.47.80/Images/GhostScriptWorkingOS92.JPG)

Unfortunately it did not work in OS8.6
(http://62.239.47.80/Images/GhostScriptErrorOS86.JPG)

I note the byte count is different for MacGSView, so I assume you have modified that in some way.... for info your MacGSView would not work with GhostScriptLib 6.01
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 31, 2016, 11:08:12 AM
Aha! Well done!
We have success, at least in OS9.2.2. I can now open the pdf form from my bank!

Unfortunately it did not work in OS8.6

I note the byte count is different for MacGSView, so I assume you have modified that in some way.... for info your MacGSView would not work with GhostScriptLib 6.01
Ahh, thats good to hear!
The best thing is most PDFs can be saved to a clean 1.3 PDF and thus be used with Acrobat again without any problems subsequently Ghostscript converted the PDF once.

But I do not get why you tried to use a 6.x lib when there always was a 8.x one working?

Next step in catching up with modern PDFs at our plattform would be that some developer would try to compile the GPL Ghostscript for Mac OS 9. Again I have no clue if there would be some "porting work" necessary, or if it could be a fast job?

If GPL Ghostscrip is a huge problem, someone could try at least the AFPL Ghostscrip 8.54. It is 13 months younger than the 8.51 that we got now (thanks MARL!).
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on December 09, 2016, 06:47:29 AM
There's a simpler alternative: Xpdf. If you don't want the graphical interface, then they claim that it can be compiled on any platform. PalmPDF is based on Xpdf and Palm was very much a Mac imitation.

I've been struggling for years with PDFs and I have several thousands of them.

The solution came when I started to use Acrobat 6 Pro on XP, with PDF Split And Merge and Atomic PDF Password Recovery. There was only 1 PDF that I couldn't convert to version 1.4. The others display correctly on OS 9.

When I have a new PDF, if it's version 1.6 or higher, I convert it with PDF Split And Merge to version 1.4.

Then I optimize with Acrobat 6, saving as version 1.4. Acrobat 6 is the last version that you don't have to activate online.

If it has a password, then this can be removed with Atomic PDF Password Recovery. It says that it's a demo, only converting x pages, but when you check it it converts everything.

JPEG2000 pictures cannot be viewed on OS 9. They can be converted to normal JPEG by Acrobat 6.

Another optimization is converting JBIG2 pictures to CCITT4, which will display faster on OS9.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on December 10, 2016, 12:44:22 AM
OS923 I don´t exactly understand your posting. First you suggest to compile, or if  needed port, Xpdf ( http://www.foolabs.com/xpdf/ )to Mac OS 9. But the rest of your posting is about optimizing PDFs with other Operating Systems for Mac OS 9. That is no real solution for people like me who use nothing else like Mac OS 9. Or did I miss something completely?

If getting a new GPL Ghostscript or Xpdf running under Mac OS 9 is more easy, should be verified by some developer. But Ghostscrip has the advantage of a well working GUI - even if it is damn slow compared to Acrobat.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Knezzen on December 10, 2016, 02:08:53 AM
I'm actually working on a PDF Viewer for Mac OS 9 that can open modern PDF's. It's not ready to be released yet and im focusing on MacTorrent at the moment, but I will probably post something about it soon :)
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on December 11, 2016, 02:59:21 PM
Knezzen, whatever you are planning, please think about the following: the most needed feature for "real world usage" beside "viewing" all recent pdfs would be a "conversion possibility" to clean PDF 1.3 or PDFx1a:2001. That would assure that the PDFs are fully usable (including manipulation with Acrobat pro) at Mac OS 9.
There are tools at Linux doing a quite good job in this direction, and most PDFs (I´d say 99%) do not use any non-printable modern functions like extreme furmulars, embedded videos, heavy JavaScripts, ...
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on December 12, 2016, 09:39:14 AM
I'm actually working on a PDF Viewer for Mac OS 9 that can open modern PDF's. It's not ready to be released yet and im focusing on MacTorrent at the moment, but I will probably post something about it soon :)
Can you be a bit more specific?
Will this be open source?
Do you use C++?
Do you use CodeWarrior?
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on December 12, 2016, 09:43:49 AM
OS923 I don´t exactly understand your posting. First you suggest to compile, or if  needed port, Xpdf ( http://www.foolabs.com/xpdf/ )to Mac OS 9. But the rest of your posting is about optimizing PDFs with other Operating Systems for Mac OS 9. That is no real solution for people like me who use nothing else like Mac OS 9. Or did I miss something completely?
No you missed nothing. Indeed, if you convert and optimize your PDFs on XP then you need no specific solution for OS 9, because as soon as your PDF is converted to version 1.4 you can do everything you want with it on OS 9. But as you say, if you use only OS 9 then there's no solution for PDFs with version >= 1.5 at this moment.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Knezzen on December 12, 2016, 10:24:19 AM
Can you be a bit more specific?
Will this be open source?
Do you use C++?
Do you use CodeWarrior?

I haven't gotten that far yet. Im using REALbasic 2006R3 on OSX to do it (the last version of REALbasic able to compile Macintosh Toolbox binarys). Will probably be open sourced as soon as I get something working. Feel free to help out if you have the time :)
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on December 15, 2016, 10:01:19 AM
2 problems:
If you can get it to work in OS 9 and I get the source code then I'm confident that I can make a faster version in C++ that draws Unicode, but I've never used QuickDraw GX.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 26, 2020, 11:23:45 AM
I need to push this thread once again, as it is still one of the most important "missing links" if you are using just Mac OS 9.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ivan_holmes on May 27, 2020, 10:48:36 AM
I have downloaded various versions of the Ghostscript source code to see how far I could get easily. My results:

GhostScript 8.51 compiles and works as expected

GhostScript 8.54 compiles using the CodeWarrior project from 8.51 (with minor adjustments) and seems to work with MacGSView. I don't know if it gives any benefits (I don't have any tricky PDFs to test), but I have attached it anyway.

GhostScript 8.70 compiles (using a CodeWarrior project generated by the included makefile, quite a few manual adjustments needed) but MacGSView won't work with it. I couldn't get MacGSView to compile (CodeWarrior too new I think), and I don't know anything about GhostScript, so whatever adjustments might need to be made to get them to play nicely are a mystery to me. 

GhostScript 8.71 is the last version in the 8.x series and it uses libtiff. Unfortunately none of the makefiles related to Mac OS 9 were updated to reflect this. I had a go but couldn't get it to work.

I may try to build GhostScript 8.6x but I am out of my depth now, I think adjustments to MacGSView may be needed for the new libraries to work well.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 27, 2020, 11:02:31 AM
Ivan, you are great. That is the OpenSource spirit that we need so much für Mac OS 9 as well.
Thanks a lot for your work! So we have an updated version to 8.54 now. I will do some tests in the upcoming weeks, and report about the improvements.

Perhaps noc Knezzen should share his project with you and see if there is something that can be done easily. The Bittorrent Client he did is working very well.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ivan_holmes on May 27, 2020, 11:40:57 AM
Thank you Mat, it is quite rewarding to get newer stuff working with old.

Perhaps noc Knezzen should share his project with you and see if there is something that can be done easily. The Bittorrent Client he did is working very well.
I have used MacTorrent myself, it is a very cool piece of software. I had to pinch myself when it actually worked!
I would be open to the idea, I wonder how far he got with it. Sadly I think serious work will be needed to get anywhere.

In terms of a true solution to PDF rendering on Mac OS 9, I am not sure if the best solution is trying to update GhostScript and MacGSView, or maybe trying to get poppler https://poppler.freedesktop.org/ (https://poppler.freedesktop.org/) to build on Mac OS 9... hopefully its dependencies are portable. I recently came across the Retro68 toolchain, which I think will be easier than trying to use CodeWarrior with modern C++.
If poppler can be built, a drag and drop conversion utility (new PDF to old, or postscript) would be possible. I did something similar for the 'Drop ALAC' utility (although the code I based that on is a lot simpler than poppler). This seems like the best path to me, creating a new reader as good as Acrobat 5.0 would take far too much work.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 27, 2020, 04:15:28 PM
If poppler can be built, a drag and drop conversion utility (new PDF to old, or postscript) would be possible. (…) This seems like the best path to me, creating a new reader as good as Acrobat 5.0 would take far too much work.
I have to agree! In fact MacGSView is damn slow compared to Acrobat 5. And a new program is not necessary. To cover 99,9% of PDF real world usage, a simple "converter" would do the trick. Nearly all PDFs are not using the newer possibilities of PDF 1.5 and up, like embedded videos or audio data, or encryption and all that stuff. So the best would be a program where you can "drag&drop" any PDF and let it create a clean PDF 1.3. For using these PDFs Acrobat is still fine.

I am using a similar program at Linux some times which is called PDFConverter and I could convert all (!) PDFs that I wanted to use the last 8 years, to clean 1.3.

If poppler is a better path (that have coders to decide) please try it. It was just that GhostScript was already available.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ivan_holmes on May 28, 2020, 08:52:19 AM
So I have looked in to this a bit more, and I am not sure how to proceed.

First of all, I hadn't done my research on poppler properly – it has loads of dependencies, including fontconfig which will not work on OS 9, so it's a dead end.

Xpdf (mentioned by OS923 4 years ago) is a much better option as it only has a couple of dependencies. It has command line utilities that can convert PDF to PS and PNG amongst other things, these are potential candidates for conversion to drag-and-drop utilities. I have managed to compile it and the necessary libraries but I can't get it to link in to an executable with Retro68 (undefined references to various symbols in libpng), probably because I don't know what I am doing... There's basically no documentation so I am stuck here for now. I might be able to come back to it when I have sharpened my skills...

This concludes my investigation, sorry I was not able to help further.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on May 29, 2020, 04:14:50 AM
Qpdf is a command-line pdf-to-pdf converter written in C++ that depends only on libjpeg-turbo which may be replaced with QuickTime's GraphicConverter.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ivan_holmes on May 29, 2020, 07:15:56 AM
It looks interesting; the site says it can force a lower version and disable unsupported features, and that it can 'optimise' images to JPEG. It sounds like it could be a solution, definitely worth further investigation.

I haven't got any 'tricky' PDFs I need to open, so perhaps anyone who does have some (that are not private of course) could upload them here. That way one could easily evaluate if QPDF does the job before bothering to start porting.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 30, 2020, 06:17:27 AM
Thanks Ivan for your investigations and time!

About Xpdf, it may be the way to go, as there are several ports to different plattforms. I do not know anything about QPDF.

Regarding tricky PDFs I will try to provide some. It may need some time, as I need to check at another OS than 9 ;)
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ivan_holmes on June 02, 2020, 04:22:55 AM
No problem, I await your tricky PDFs if you are able to find any. I'm learning as I go though, so don't expect much.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: IIO on June 02, 2020, 10:58:30 PM
And a new program is not necessary. To cover 99,9% of PDF real world usage, a simple "converter" would do the trick.

for me it does not happen too often that a pdf cant be read on OS9, but when it happens, then it is really annoying that there is no solution other than what OS923 described above in 2016. (using 3 different utilities under windows^^)

and i dont think it will be so easy to make a pdf converter for OS9, because converting requires reading and understanding - and if you could do that, you could as well display new formats directly. (i.e. only display the conversion but not touch the file.)

or maybe we´re just overlooking that one app which already does it? i needed quite a while until i found out that there is a dozen of OS9 apps which can open docx or rtf back in the days.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on June 03, 2020, 06:55:11 AM
converting requires reading and understanding - and if you could do that, you could as well display new formats directly. (i.e. only display the conversion but not touch the file.)
I disagree. Drawing is more complicated than conversion. I'm looking into Qpdf in which I want to replace libjpeg-turbo with the original jpeglib, which is a bit slower, but it has no dependencies.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: IIO on June 04, 2020, 02:29:36 AM
for a quick reader app, couldnt you just print a bitmap to screen or something?
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: IIO on June 04, 2020, 02:31:33 AM
oh but yes, i iknow what you mean. converting can of course start at such simple things like changing the version number or converting a single picture, you  dont need to render everything. not sure what i was thinking when i wrote that.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ivan_holmes on June 04, 2020, 06:29:04 AM
Qpdf already supports linking with normal jpeglib so you shouldn't have many problems with that part, at least.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on June 05, 2020, 01:37:07 AM
From https://sourceforge.net/projects/qpdf/files/contrib/vc6/

Code: [Select]
This area contains a port of qpdf to make it build with Microsoft
Visual C++ version 6.0.  This port has been generously provided by
Jian Ma <[email protected]> who has agreed to allow them to
distributed under the same terms as qpdf.  I am grateful for his
contribution.

VC6 is too old to support qpdf directly, but only minor modifications
were required to make it work.

If they can make it work in Visual C++ 6 then we have a good chance that it will work on OS 9. It uses the standard templates library and I didn't see includes of missing files.

The main problem is that the downloads (qpdf, libjpeg and zlib) contain much clutter, make files, test files, test programs, cryptic file names and file names that are too long for OS 9 and that everything should be ordered and linked as 3 libraries with test programs.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on June 08, 2020, 01:58:41 AM
I linked libjpeg and zlib. Qpdf uses templates that I don't have. Which version of STL would they use?
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on June 24, 2020, 10:24:44 AM
See solution in attachment.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: adespoton on July 13, 2020, 10:02:01 AM
To go down a completely different route, has anyone investigated the open source javascript PDF viewer bundled in the likes of Firefox?  This would be post-classilla, but as the code is available, maybe it works with a javascript runtime that'll run in OS 9?  It might also be something that could be ported to C++ or MacPython.

This would have the added benefit that it supports modern PDF versions and just ignores the objects (encrypted forms, etc.) that it can't handle, instead of refusing to open the PDF at all.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: OS923 on July 15, 2020, 11:16:41 AM
In my experience it would require Java that is too sophisticated for OS 9.

I wouldn't recommend Qpdf either because when I link it as a static library or if I try to separate it from the console then I get weird bugs, which indicates that this software isn't kosher. I won't include this in OS 9.3.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: ivan_holmes on August 08, 2020, 12:54:30 PM
See solution in attachment.

I've only just seen this - thought I had notifications on for this thread. Anyway, I checked it out and it looks very useful, will have to look in more detail sometime.

To go down a completely different route, has anyone investigated the open source javascript PDF viewer bundled in the likes of Firefox?

My gut instinct is that this will be too difficult - I doubt a suitable JS runtime exists.
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Mat on May 23, 2021, 07:15:16 PM
I'm actually working on a PDF Viewer for Mac OS 9 that can open modern PDF's.
… but I will probably post something about it soon :)
I do not intend to create any pressure! I just like to suggest to think about having the program ready when we celebrate the 10th aniversary of this thread. ;)
Title: Re: Simple PDF Solution; "Gostscript" -> Developer Needed
Post by: Knezzen on May 24, 2021, 03:39:49 AM
I'm actually working on a PDF Viewer for Mac OS 9 that can open modern PDF's.
… but I will probably post something about it soon :)
I do not intend to create any pressure! I just like to suggest to think about having the program ready when we celebrate the 10th aniversary of this thread. ;)

I actually dropped this after OS923 pointed out the Unicode stuff to me. I don't really know where the sources are now, but I can have a look.
Quite sure they are horrible :P