Message "Not a valid PDF"???

Started by ildolce77, January 26, 2016, 04:46:39 AM

Previous topic - Next topic

ildolce77

When I try to change any value on a pdf file I receive a message "Not a valid PDF" ¿?
I can see the metadata of this file but I can't do any change over this.

C:\dev\exiftool>"exiftool.exe" -About="" -By-line="" -Caption-Abstract="" -Client_UI="" -Comment="" -Copyright="" -CopyrightNotice="" -CreatorTool="" -Credit="" -DerivedFromDocumentID=""
-DerivedFromInstanceID="" -DerivedFromOriginalDocumentID="" -DocChangeCount="" -DocumentAncestors="" -DocumentID="" -ExifVersion="" -For="" -GPSAltitude="" -GPSAltitudeRef=""
-GPSImgDirection="" -GPSImgDirectionRef="" -GPSLatitude="" -GPSLatitudeRef="" -GPSLongitude="" -GPSLongitudeRef="" -GPSTimeStamp="" -GPSVersionID="" -History="" -HistoryAction=""
-HistoryChanged=""-HistoryInstanceID="" -HistoryParameters="" -HistoryParams="" -HistorySoftwareAgent="" -HistoryWhen="" -ImageDescription="" -InstanceID="" -LensMake=""
-LensModel="" -Make="" -ManifestReferenceDocumentID="" -ManifestReferenceFilePath="" -ManifestReferenceInstanceID="" -Model="" -OriginalDocumentID="" -PDFVersion=""
-PhotoshopBGRThumbnail="" -PhotoshopThumbnail="" -Producer="" -Rights="" -Software="" -SourceModified="" -SubSecTime="" -ThumbnailFormat="" -ThumbnailImage="" -ThumbnailWidth=""
-URL="" -UserComment="" -Version="" -VersionID="" -WebStatement="" -XMPToolkit="" -XPAuthor="" -Creator="Renta4 Banco" -Author="Renta4 Banco" -r -overwrite_original NC.pdf
Warning: Tag 'Client_UI' does not exist
Warning: Tag 'DocChangeCount' does not exist
Warning: Tag 'HistoryParams' does not exist
Warning: Tag 'SourceModified' does not exist
Error: Not a valid PDF - NC.pdf
    0 image files updated
    1 files weren't updated due to errors


Phil Harvey

Thanks for this report.

There are some extra whitespace characters at the start of this PDF file that shouldn't be there.  As well, the header seems duplicated in a funny way.  I'm surprised that PDF viewers will open this file.  I'll have to read the PDF specification when I get a chance to see if this is allowed.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ildolce77

Hi Phil.

I have two more warnings with these files:
http://www.fondotop.com/documentos/revista/fondonewsn1pc2.pdf (Unsupported Filter /ASCII85Decode)
http://www.renta4banco.com/recursos/pdf/estatutosr4.pdf (XMP format error)

Regards


Phil Harvey

#3
Thanks for these samples.

I will add support for the ASCII85Decode filter.

As far as the XMP format error goes, the problem is that the XMP is not encrypted as it should be.  Adobe Bridge doesn't read this XMP either (although it doesn't give a warning).  So this is a problem with the file, not ExifTool.

- Phil

Edit:  I looked into the spec, and I can't see where it is allowed to have white space before the PDF file header, so I think that ExifTool is correct for your earlier sample when it reported "Not a valid PDF".
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).