You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One small thing I got today is that my generated pdf has some validation issues:
1.4.1 : Trailer Syntax error, The trailer dictionary doesn't contain ID
3.1.1 : Invalid Font definition, Some required fields are missing from the Font dictionary.
3.1.2 : Invalid Font definition, FontDescriptor is null or is a AFM Descriptor
7.1 : Error on MetaData, Missing Metadata Key in catalog
# I'm generating PDF file:
Prawn::Document.generate("metadata.pdf",
:info => {
:Title => "My title",
:Author => "John Doe",
:Subject => "My Subject",
:Keywords => "test metadata ruby pdf dry",
:Creator => "ACME Soft App",
:Producer => "Prawn",
:CreationDate => Time.now
}) do
text "This is a test of setting metadata properties via the info option."
text "While the keys are arbitrary, the above example sets common attributes."
end
# Then try to validate generated file with "pdf_validator" gem (https://github.com/bitzesty/pdf_validator):
> path_to_pdf = "#{Rails.root}/metadata.pdf"
> res = PdfValidator.validate(path_to_pdf)
> res[:errors].map { |e| puts e }
1.4.1 : Trailer Syntax error, The trailer dictionary doesn't contain ID
3.1.1 : Invalid Font definition, Some required fields are missing from the Font dictionary.
3.1.2 : Invalid Font definition, FontDescriptor is null or is a AFM Descriptor
7.1 : Error on MetaData, Missing Metadata Key in catalog
Validating file "innovation_award_Dec_18_2014(1).pdf" for conformance level pdfa-1a
The file trailer dictionary must have an id key.
The key Metadata is required but missing.
The key MarkInfo is required but missing.
A device-specific color space (DeviceGray) without an appropriate output intent is used.
A device-specific color space (DeviceRGB) without an appropriate output intent is used.
The key F is required but missing. (2)
The value of the key SMask is an image but must be None. (2)
The value of the key CA is 0 but must be 1.0. (2)
The value of the key ca is 0 but must be 1.0. (2)
The font Helvetica-Bold must be embedded.
The font Helvetica-Oblique must be embedded.
The font Helvetica must be embedded.
The document does not conform to the requested standard.
The document contains device-specific color spaces.
The document contains fonts without embedded font programs or encoding information (CMAPs).
The document contains transparency.
The document contains hidden, invisible, non-viewable or non-printable annotations.
The document's meta data is either missing or inconsistent or corrupt.
The document doesn't provide appropriate logical structure information.
Done.
Maybe someone is experienced with same issue and know how to fix it.
Thanks for any help 🍻
The text was updated successfully, but these errors were encountered:
I didn't know that this validator gem existed! Very interesting, and if the warnings it popped up are due to invalid or bad output from Prawn, we'll definitely be interested in fixing this. Can you re-post this issue over to https://github.com/prawnpdf/pdf-core, which is the underlying PDF library Prawn uses?
Also, because it'll take me a long time before I can look into this, further research and/or patches are welcome from you or anyone else!
@sandal I only created the gem last night, but yes we have a requirement to make the pdfs we generate PDF/A compliant so happy to help get to the bottom of this.
Hey Guys,
I'm very happy to use prawn 👍
One small thing I got today is that my generated pdf has some validation issues:
So I use latest version of prawn:
In rails console:
Then I also uploaded generated "metadata.pdf" file to http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx
and got some issues in results:
Maybe someone is experienced with same issue and know how to fix it.
Thanks for any help 🍻
The text was updated successfully, but these errors were encountered: