Skip to content
  • Thomas Fischer's avatar
    pdfinfo: improved paper size recognition · 78840bb7
    Thomas Fischer authored
    Paper sizes of ISO 216, A Series were originally defined in millimeters.
    For example, A3 is defined to be 297mm x 420mm. However, depending on
    source, the corresponding size in pts may vary between 1190pt and 1191pt
    for the longer edge.
    
    pdfinfo's formula to compute the length of the longer edge of an A3
    paper determines this length to be 1191.82pt. As the error margin so far
    was set to 1pt, A3 papers with edge length of 1190.8pt were not
    recognized as A3.
    
    This patch makes the error margin depending on the paper size, setting
    it at 0.3% of the longer edge's length. For A3 paper, the error marging
    (variable 'isoThreshold') thus becomes 3.58pt.
    
    Accordingly, the threshold for 'letter' paper has been raised from 0.1pt
    to 1pt.
    78840bb7