Page 1 of 2

Request: IsPDF function

Posted: Thu May 17, 2018 5:52 pm
by jPV
Would it be possible to make an IsPDF function to check if PDF is recognized and can be opened? I have some PDF files which fail to open and would be nice to be able to check them in a clean way rather than writing a custom error handling routine.

Re: Request: IsPDF function

Posted: Thu May 17, 2018 6:23 pm
by Juan Carlos
Do you try to make one Pdf program with PolĂ­ticos?
I do this question because I think that instead of all Hollywood user we try to make our own Pdf program, someone of our make it. Because it is interesting a new Pdf program for all Amiga systems made with Hollywood.

Re: Request: IsPDF function

Posted: Thu May 17, 2018 7:46 pm
by jPV
I'm adding PDF support to RNOComics, but I have to rewrite some stuff and it probably will be a bit hack&patch style solution, because it doesn't suit directly to the structure I've made for earlier purposes :) But I'm expecting that it will be OK to use RNOComics as a generic PDF reader too, and not just comics reader.

But I'm not planning to add more PDF specific features for now, mainly just PDF support to the current design. Sooo.. if someone wants to write a totally dedicated program for PDFs, I guess there's room for it too.

Re: Request: IsPDF function

Posted: Thu May 17, 2018 11:10 pm
by Juan Carlos
Perhaps the option will be make a little bounty for someone try to make a pdf reader with polybios.

Re: Request: IsPDF function

Posted: Fri May 18, 2018 4:39 pm
by airsoftsoftwair
Yes, can be added.

Re: Request: IsPDF function

Posted: Fri May 18, 2018 5:44 pm
by jPV
Maybe it could also return number of pages in the PDF, to get that more straightforward way? Or possibly some other information too...

Re: Request: IsPDF function

Posted: Fri May 18, 2018 6:22 pm
by airsoftsoftwair
jPV wrote:Maybe it could also return number of pages in the PDF, to get that more straightforward way? Or possibly some other information too...
This would require PDF parsing and would slow down the IsPDF() function so it's better to use OpenDocument() if you need additional information.

Re: Request: IsPDF function

Posted: Fri May 17, 2019 7:39 pm
by airsoftsoftwair

Code: Select all

- New: Added pdf.IsPDF() function; this can be used to check if the specified file is a PDF document

Re: Request: IsPDF function

Posted: Sat May 18, 2019 9:50 am
by jPV
Thanks!

BTW. I've forgot to ask earlier, but I got these couple PDF files (link) from one user and they don't open with Polybios. They do work with APDF and VPDF... so any idea why they don't work with Polybios?

Re: Request: IsPDF function

Posted: Sat May 18, 2019 12:43 pm
by airsoftsoftwair
Which system is he on? On Windows, those PDFs can be opened just fine...