Search code examples
pdfadobe

PDF graphic object - what language is this?


I'm trying to figure out what kind of language and how can I read/convert the following graphic object found inside a pdf

q
0 869 634 -869 re
W n
0 0.9 0.85 0 K
/GS0 gs
q 1 0 0 1 319 606 cm
0 0 m
0 -53.02 -42.98 -96 -96 -96 c
-149.02 -96 -192 -53.02 -192 0 c
-192 53.02 -149.02 96 -96 96 c
-42.98 96 0 53.02 0 0 c
h
S
Q

those seem postfix instructions but I don't know what they are. Can somebody shed some light on it?


Solution

  • You need to check the Adobe PDF reference; what you have in there is just plain PDF code as can be found in any page description for a page in a PDF document. Download the PDF reference from the Adobe web site here: http://www.adobe.com/devnet/pdf/pdf_reference.html

    Loosely translated, the piece of code you have, does the following

    • save graphics state
    • create rectangle
    • add rectangle to clipping path
    • set color to CMYK color
    • set graphics state GS0
    • set current transformation matrix
    • move to point 0, 0
    • add curve, add curve, add curve, add curve
    • close path
    • stroke path
    • restore graphics state