誰かがpdfのbegintextセクションの実際のピクセル座標を取得するのを手伝ってくれますか? pdfbox を使用して pdf ファイルからテキストを取得していますが、そのテキスト セクション/段落を囲んでいる四角形を取得する必要があります。
$contents = $page->getContents();
$contentsStream = $page->getContents()->getStream();
$resources=$page->getResources();
$fonts = $resources->getFonts();
$xobjects = $resources->getImages();
$tokens=$contentsStream->getStreamTokens();
[PDFOperator{q}、COSFloat{690.48}、COSInt{0}、COSInt{0}、COSFloat{633.6}、COSInt{0}、COSInt{0}、PDFOperator{cm}、COSName{im1}、PDFOperator{Do} 、PDFOperator{Q}、
PDFOperator{BT}、COSInt{1}、COSInt{0}、COSInt{0}、COSInt{1}、COSFloat{25.92}、COSFloat{588.48}、PDFOperator{Tm}、COSInt{99}、PDFOperator{Tz}、 COSName{F30}、COSInt{56}、PDFOperator{Tf}、COSInt{3}、PDFOperator{Tr}、COSFloat{0.334}、PDFOperator{Tc}、COSString{Pospremanj}、PDFOperator{Tj}、COSInt{0}、 PDFOperator{Tc}、COSString{e}、PDFOperator{Tj}、COSFloat{9.533}、PDFOperator{Tw}、COSString{i}、PDFOperator{Tj}、COSFloat{6.062}、PDFOperator{Tw}、COSFloat{0.95}、 PDFOperator{Tc}、COSString{ ciscenj}、PDFOperator{Tj}、COSInt{0}、PDFOperator{Tc}、COSString{e}、PDFOperator{Tj}、COSInt{1}、COSInt{0}、COSInt{0}、 COSInt{1}、COSFloat{55.68}、COSFloat{539.76}、PDFOperator{Tm}、COSInt{0}、PDFOperator{Tw}、COSFloat{0.262}、PDFOperator{Tc}、COSString{uoè}、PDFOperator{Tj}、 COSInt{0}、PDFOperator{Tc}、COSString{i}、PDFOperator{Tj}、COSFloat{5.443}、PDFOperator{Tw}、COSFloat{-2.145}、PDFOperator{Tc}、COSString{zimslco}、PDFOperator{Tj}、COSInt{0}、PDFOperator{Tc}、COSString{g}、PDFOperator{Tj}、COSFloat{7.202}、PDFOperator{Tw} 、COSFloat{-0.148}、PDFOperator{Tc}、COSString{ odmor}、PDFOperator{Tj}、COSInt{0}、PDFOperator{Tc}、COSString{a}、PDFOperator{Tj}、PDFOperator{ET}、
PDFOperator{BT}、COSInt{1}、COSInt{0}、COSInt{0}、COSInt{1}、COSFloat{6.72}、COSFloat{513.12}、PDFOperator{Tm}、COSInt{0}、PDFOperator{Tw}、 COSName{F30}、COSInt{14}、PDFOperator{Tf}、COSString{}、PDFOperator{Tj}、COSFloat{2.751}、PDFOperator{Tw}、...
すべての単語/文字に対して PrintTextLocations 関数が行うような出力を取得したいと思います。下と左の座標は取得できますが、幅と上の座標を取得するにはどうすればよいですか?
印刷テキストの場所:
- String [25.92,45.119995 FS = 56.0 XSCALE = 55.440002高さ= 40.208004スペース= 15.412322幅= 36.978485] P String [63.22914,45.119995 FS = 56.0 XSCALE = 55.440002 Height = 40.20.20.20.20.20.2088004 = 56.0 XScale = 55.440002高さ= 40.208004スペース= 15.412322幅= 30.824646] S String [128.58894,45.119995 FS = 56.0 XSCALE = 55.4440002 height = 42.168 fige = 15.412322 width = 3.873445.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.45.4. =42.168 space=15.412322 width=21.566162]r string[184.69026,45.119995 fs=56.0 xscale=55.440002 height=42.168 space=15.412322 width=30.824646]e string[215.84557,45.119995 fs=56.0 xscale=55.440002 height=42.168 space=15.412322 width =49.286148]m ...