Back to DJ


1.   An Example of pdf commands sequence and  DJ objects (from 3312-5-4.pdf )

This example is in two parts, one is for drawing, the other is for text. The graph from the drawing commands below is the right most bar in the pdf file, which has a clip path(rectangle). The text below is the name for the left bar chart, "G184AS".


Drawing:

Commands   Description
q
Push current Graphics(G0) State to Stack
533.182 605.288 6.377 -10.536 re Clip path
W*

n
End of Clip path
1 1 1 1 K Begin to draw some paths with new Graphics State (G1)
0 J
1.002 w
537.154 606.677 m
530.997 596.014 l
541.493 604.172 m
535.337 593.508 l
527.95 602.266 m
534.107 591.603 l
532.29 604.772 m
538.447 594.108 l
536.63 607.277 m
542.786 596.614 l
S
Stroke paths with Graphics State (G1: 1111 k, 0 J, 1.0002 w)
Q
Pop the top Graphics State(G0)  from Stack
533.182 605.288 6.377 -10.536 re Draw rectangle, which is the same as the clip path
S Stroke this rectangle with Graphics State (G0) as the boundary


The DJ objects we get above are 5 DPath objects and 1 DRectangle object.

DPath Objects
Begin Point
End Point
Operation
Color
Width
Horizontal
Vertical
1st DPath
537.154 606.677 530.997 596.014 Stroke
Black
1.002
false
false
2nd DPath
541.493 604.172 535.337 593.508 Stroke
Black
1.002
false
false
3rd DPath
527.95 602.266 534.107 591.603 Stroke
Black
1.002
false
false
4th DPath
532.29 604.772 538.447 594.108 Stroke
Black
1.002
false
false
5th DPath
536.63 607.277 542.786 596.614 Stroke
Black
1.002
false
false

                             
DRectangle Object
Origin Point (left upper)
Width
Height Operation
Graphics States
1st DRectangle
533.182,  605.288 6.377 10.536 Stroke G0




Text:

Commands
Description
0 7.763 -7.763 1.65 367.045 521.684 Tm ext Matrix, rotate text following to be vertical 
(G184AS) Tj  Text shown


The DJ object is a DText object:  

DText Object
Text
Matrix
Origin Point
Length
Direction
DText
"G184AS" 0 7.763 -7.763 1.65 367.045 521.684 367.045, 521.684 LENGTH_CHARACTER * character number of "G184AS" vertical




2.    Statistics

Diagram:  3312-5-4.pdf
Statistics:     Number of DPath objects: 660,     Number of DRectangle objs:  15,     Number of DText objects:  48
The code counting the numbers is DiagramCounter.java .


3.  A diagram can be slice-diced

Diagram: 1183-9-5.pdf

There are three data files created from slice-dice code, named  1183-9-5-diagram-0.dat, 1183-9-5-diagram-1.dat, and 1183-9-5-diagram-2.dat respectively, at /proj/bkl/myshao/download/pdf/result/slice-dice-data-files/. But I can't make sure that the three data files are the three parts to be slice-dices, though this file looks easy to be slice-diced easily and reasonablely.





Back to DJ