SetLineWidth / modify Stroke - Unit problem

Help
Hakan
2013-09-12
2013-09-12
  • Hakan

    Hakan - 2013-09-12

    Hello,

    I am able to sucessfully modify “SetLineWidth” value using the code sample
    provided in ContentTweakingSample.cs (from the 0.1.0 Alpha build) – it
    works fine in 0.1.2 release as well for SOME pdf files.

    My problem is that I get PDF files from many different sources and created
    by different drivers or applications – and I cannot find the UNITS of the
    LineWidth value. The content of these PDF files are complex CAD drawings,
    not just text. I tried the page dictionary object, “UserUnits” but it is
    useless, it is not defined for many PDF’s and the adobe spec confirms it is
    optional as of version 1.6.

    The UNITS of setLineWidth.Value is not at 1/72” points for many PDF files

    I have prepared a proof of concept to extract all unique linewidths
    (basically the stroke value) from a PDF and see the following examples

    Line Thickness Detected for : test1.pdf

    2.03753

    4.07507

    2.71671

    5.43342

    8.15013

    In this case it is 1" in file = 407.5 units in PDF, or 1 unit in Linewidth
    value equals 1/407.5”

    Line Thickness Detected for : test2.pdf

    6

    4

    2

    0

    9

    8

    3

    • In this case it is 1" in file = 600 units in PDF, or 1 unit in Linewidth
      value equals 1/600*

    • *

    Line Thickness Detected for : test3.pdf

    1.02

    0.72

    1.14

    1.5

    0.36

    0.12

    0.42

    1.44

    0.06

    0.24

    In this case it is 1" in file = 72 units in PDF (the PDF default units), 1
    unit = 1/72”

    • *

    My question is – I need to set minimum linewidth to a known value – using
    1/72” for conversion fails on many PDF files for the above reason.

    How Can I detect the user units of the page or the linewidths (stroke)
    that has been used and set it consistently to a desired minimum ?

    Thank you for any help

    Hakan

     
  • Hakan

    Hakan - 2013-09-12

    sorry about double post, initial email post did not show up. I cannot delete posts, admin kindly delete one of the threads. thanks

     
    Last edit: Hakan 2013-09-12

Log in to post a comment.