itextsharp を使用して PDF を抽出し、2 つの PDF をスタイルで比較するために html に変換しました。これで、テキストの配置のために左と上の位置を追加しました。しかし、上付き文字を受け取るとすぐに、テキストの位置が変わります。しかし、firebug を確認すると、Adobe Illustrator を使用して確認したときと左右の位置が同じです。誰でも私に電話できますか?なぜそれが起こっているのか.私が投稿した例では、7 の数字は "was" の下にあるはずですが、"was" からは離れています。
Vector curBaseline = renderInfo.GetBaseline().GetStartPoint();
Vector topRight = renderInfo.GetAscentLine().GetEndPoint();
y_direction_source = Form1.Pagesize_source +( height_extract_source_page - curBaseline[Vector.I2]);
this.result.AppendFormat("<p style=\"left:{0}pt;top:{1}pt;\">" curBaseline[Vector.I1], y_direction_source);
結果:
<p style="font-family:TimesNewRoman;font-size:12.2618001271429pt;font-weight:;font-style:;left:42pt;top:120.2399pt;position:absolute;">
<p style="background: cyan">training</p>
<p style="background: cyan">camps</p>
<pp style="background: cyan">in</p>
<pp style="background: cyan">Afghanistan</p>
<pp style="background: cyan">.</p>
</p>
<pp style="font-family:TimesNewRoman;font-size:10.2386067682737pt;font-weight:;font-style:;left:441.48pt;top:114.72pt;position:absolute;">
<pp style="background: cyan">7</p>
</p>