Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8811535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:23:22+00:00 2026-06-14T03:23:22+00:00

I’m trying to write what more or less accounts for a PDF soft proof.

  • 0

I’m trying to write what more or less accounts for a PDF soft proof.

There are a few infos that I would like to extract, but have no clue how to.

What I need to extract:

Bleed:                    I got this somewhat working with pyPdf, given
                          that the document uses 72 dpi, which sadly isn't
                          always the case. I need to be able to calculate
                          the bleed in millimeters.

Print resolution (dpi):   If I read the PDF spec[1] correctly this ought to
                          always be 72 dpi, unless a page has UserUnit set,
                          which was only introduced in PDF-1.6, but shouldn't
                          print documents always be at least 300 dpi? I'm
                          afraid that I misunderstood something…

                          I'd also need the print resolution for images, if
                          they can differ from the default page resolution,
                          that is.

Text color:               I don't have the slightest clue on how to extract
                          this, the string 'text colour' only shows up once
                          in the whole spec, without any explanation how it
                          is set.

Image colormodel:         If I understand it correctly I can read this out
                          in pyPdf with page['/Group']['/CS'] which can be:
                             - /DeviceRGB
                             - /DeviceCMY
                             - /DeviceCMYK
                             - /DeviceGray
                             - /DeviceRGBK
                             - /DeviceN

Font 'embeddedness':      I read in another post on stackoverflow that I
                          can just iterate over the font resources and if a
                          resource has a '/FontFile'-key that means that
                          the font is embedded. Is this correct?

If other libs than pyPdf are better able to extract this info (or a combination
of them) they are more than welcome. So far I fumbled around with pyPdf, pdfrw
and pdfminer. All of which don’t exactly have the most extensive documentation.

[1] http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:23:23+00:00Added an answer on June 14, 2026 at 3:23 am

    If I read the PDF spec1 correctly this ought to always be 72 dpi,
    unless a page has UserUnit set, which was only introduced in PDF-1.6,
    but shouldn’t print documents always be at least 300 dpi? I’m afraid
    that I misunderstood something…

    You do misunderstand something. The default user space unit which defaults to 1/72 inch but can be changed on a per-page base since PDF-1.6, is not defining a print resolution, it merely defines what length a unit in coordinates given by the user by default (i.e. unless any size-changing transformation is active) corresponds to.

    For printing all data are converted into a device dependent space whose resolution has nothing to do with the user space coordinates. Printing resolutions depend on the printing device and their drivers; they may be limitted due to security settings allowing low quality printing only.

    I’d also need the print resolution for images, if they can differ from
    the default page resolution, that is.

    Images (well, bitmap images, in PDF there are also vector graphics) come each with their individual resolution and then may be transformed (e.g. enlarged) before being rendered. For an “image printing resolution” you’d, therefore, have to inspect each and every bitmap image and each and every page content in which it is inserted. And if the image is rotated, skewed and asymmetrically stretched, I wonder what number you will use as resolution… 😉

    Text color: I don’t have the slightest clue on how to extract this, the string
    ‘text colour’ only shows up once in the whole spec, without any
    explanation how it is set.

    Have a look at section 9.2.3 in the spec:

    The colour used for painting glyphs shall be the current colour in the
    graphics state: either the nonstroking colour or the stroking colour
    (or both), depending on the text rendering mode (see 9.3.6, “Text
    Rendering Mode”). The default colour shall be black (in DeviceGray),
    but other colours may be obtained by executing an appropriate
    colour-setting operator or operators (see 8.6.8, “Colour Operators”)
    before painting the glyphs.

    There you find a number of pointers to interesting sections. Be aware, though, text is not simply coloured; it may also be rendered as a clip path applied to any background.

    I read in another post on stackoverflow that I can just iterate over
    the font resources and if a resource has a ‘/FontFile’-key that means
    that the font is embedded. Is this correct?

    I would advice a more precise analysis. There are other relevant keys, too, e.g. ‘/FontFile2’ and ‘/FontFile3’, and the correct one must be used.

    Don’t underestimate your tasks… you should start to define what the properties you search shall mean in a mixed environment of rotated, stretched and skewed glyphs, vector graphics and bitmap images like PDF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
I know there's a lot of other questions out there that deal with this
I'm trying to create an if statement in PHP that prevents a single post
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.