pdf-value ( obj -- str ) - Factor Documentation

pdf-value ( obj -- str )


Vocabulary
pdf .values

Inputs
obj an object


Outputs
str an object


Definition
IN: pdf.values

GENERIC: pdf-value ( obj -- str )


Methods
USING: colors formatting kernel pdf.values ;

M: color pdf-value >rgba-components drop "%f %f %f" sprintf ;


USING: kernel pdf.values ;

M: f pdf-value drop "false" ;


USING: accessors combinators fonts kernel make pdf.values
sequences splitting ;

M: font pdf-value
[
"<<" , "/Type /Font" , "/Subtype /Type1" , {
[
name>> {
{ "sans-serif" ~quotation~ }
{ "serif" ~quotation~ }
{ "monospace" ~quotation~ }
[ " is unsupported" append throw ]
} case
]
[
[ bold?>> ] [ italic?>> ] bi or
[ "-" append ] when
]
[ bold?>> [ "Bold" append ] when ]
[ italic?>> [ "Italic" append ] when ]
[
name>> { "sans-serif" "monospace" } member?
[ "Italic" "Oblique" replace ] when
]
} cleave "/BaseFont " prepend , ">>" ,
] { } make join-lines ;


USING: assocs hashtables kernel make pdf.values ;

M: hashtable pdf-value
[
"<<\n" % [ swap % " " % pdf-value % "\n" % ] assoc-each
">>" %
] "" make ;


USING: math math.parser pdf.values ;

M: number pdf-value number>string ;


USING: accessors combinators io io.streams.string kernel
pdf.layout pdf.values ;

M: pdf-info pdf-value
[
"<<" print [
[
timestamp>>
[ "/CreationDate " write pdf-write nl ] when*
] [
producer>>
[ "/Producer " write pdf-write nl ] when*
]
[ author>> [ "/Author " write pdf-write nl ] when* ]
[ title>> [ "/Title " write pdf-write nl ] when* ] [
creator>>
[ "/Creator " write pdf-write nl ] when*
]
] cleave ">>" print
] with-string-writer ;


USING: accessors formatting kernel pdf.layout pdf.values ;

M: pdf-ref pdf-value
[ object>> ] [ revision>> ] bi "%d %d R" sprintf ;


USING: make pdf.values sequences ;

M: sequence pdf-value
[ "[" % [ pdf-value % " " % ] each "]" % ] "" make ;


USING: pdf.values pdf.values.private sequences strings ;

M: string pdf-value escape-string "(" ")" surround ;


USING: kernel pdf.values ;

M: t pdf-value drop "true" ;


USING: calendar formatting pdf.values sequences ;

M: timestamp pdf-value "%Y%m%d%H%M%S" strftime "D:" prepend ;

AltStyle によって変換されたページ (->オリジナル) /