[poppler] About getFileSpecNameForPlatform

Carlos Garcia Campos carlosgc at gnome.org
Wed Jul 8 08:05:49 PDT 2009


El mié, 08-07-2009 a las 07:05 -0700, Leonard Rosenthol escribió:
> Regardless of what your bug says, ISO 32000-1 (7.11.3) is quite clear
> on the implementation details.  In the paragraph above the table it
> clearly states: "Regardless of the platform, conforming readers should
> use the F and UF (beginning with PDF 1.7) entries to specify files."
> In addition, for the DOS, Mac and Unix entries in Table 44 it clearly
> says " This entry is obsolescent" (which is grammatically wrong, and
> I'll get that fixed, but technically correct).
> 
> I also verified Acrobat's implementation and in accordance with the
> spec, we do NOT look at the DOS, Mac or Unix entries when processing a
> FileSpec.  
> 
> So, it's clearly up to you what you want to do - but I would think
> that compliance with the spec AND compatibility with Acrobat/Reader
> would be highest priority.

Ok, I'll fix it then, it's more important to follow the spec rather than
"fixing" broken documents. 

Thanks Leonard. 

> Leonard
> 
> -----Original Message-----
> From: poppler-bounces at lists.freedesktop.org [mailto:poppler-bounces at lists.freedesktop.org] On Behalf Of Carlos Garcia Campos
> Sent: Wednesday, July 08, 2009 5:30 AM
> To: poppler at lists.freedesktop.org
> Subject: Re: [poppler] About getFileSpecNameForPlatform
> 
> El mar, 30-06-2009 a las 18:23 -0700, Leonard Rosenthol escribió:
> > I would actually recommend you inverse this, trying to use the UF 
> > first (since it's the newest and most generic), then falling back to F 
> > (also generic) and then finally looking for Dos/Unix/Mac.  Also, since 
> > those last three are almost never generated, you'll find the value 
> > faster.
> 
> That wouldn't work for the document attached to bug 22551 which contains the following action:
> 
> /Title ([Quellen])
> /A <<
> /S /Launch
> /F <<
> /F (../../../quellen/zip/95/5-313.zip)
> /Unix (../../../quellen/tar/95/5-313.tgz)
> >>
> 
> I think the idea here is to use the tgz when the document is running on a Unix system and the zip file otherwise. The spec says F is required only when Unix, Mac, etc. are all missing. 
> 
> I'll push the patch as it is right now at the moment. 
> 
> > Leonard
> > 
> > -----Original Message-----
> > From: poppler-bounces at lists.freedesktop.org 
> > [mailto:poppler-bounces at lists.freedesktop.org] On Behalf Of Albert 
> > Astals Cid
> > Sent: Tuesday, June 30, 2009 5:12 PM
> > To: poppler at lists.freedesktop.org
> > Subject: [poppler] About getFileSpecNameForPlatform
> > 
> > Hi, file on bug 22551 is failing on getFileSpecNameForPlatform
> > 
> >   if (fileSpec->isDict()) {
> > #ifdef WIN32
> >     if (!fileSpec->dictLookup("DOS", &obj1)->isString()) { #else
> >     if (!fileSpec->dictLookup("Unix", &obj1)->isString()) { #endif
> >       obj1.free();
> >       if (fileSpec->dictLookup("UF", &obj1)->isString ()) {
> >         name = obj1.getString()->copy();
> >       } else if (fileSpec->dictLookup("F", &obj1)->isString ()) {
> >         name = obj1.getString()->copy();
> >       } else {
> >         error(-1, "Illegal file spec in link");
> >       }
> >     }
> >     obj1.free();
> > 
> >   // error
> >   } else {
> >     error(-1, "Illegal file spec in link");
> >   }
> > 
> > The thing is that i seem to miss a else here, i mean if Unix is not 
> > found we use UF or F, but if Unix is found shouldn't we do  name = 
> > obj1.getString()->copy();
> > 
> > Carlos i think this code is yours, is it a typo/bug or am i missing something?
> > 
> > Albert
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
> 
> 
> --
> Carlos Garcia Campos
> PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462


-- 
Carlos Garcia Campos
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
 digitalmente
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090708/f0204021/attachment-0001.pgp 


More information about the poppler mailing list