M: p pdf-width
[ style>> set-style ] keep
- [ font>> ] [ string>> ] bi* lines
+ [ font>> ] [ string>> ] bi* split-lines
[ dupd text-width ] map nip supremum ;
M: text pdf-width
[ style>> set-style ] keep
- [ font>> ] [ string>> ] bi* lines
+ [ font>> ] [ string>> ] bi* split-lines
[ dupd text-width ] map nip supremum ;
"/Type /Catalog"
"/Pages 15 0 R"
">>"
- } unlines ;
+ } join-lines ;
: pdf-pages ( n -- str )
[
"/Kids [ " "]" surround ,
] bi
">>" ,
- ] { } make unlines ;
+ ] { } make join-lines ;
: pdf-page ( n -- page )
[
"/F10 12 0 R /F11 13 0 R /F12 14 0 R" ,
">> >>" ,
">>" ,
- ] { } make unlines ;
+ ] { } make join-lines ;
: pdf-trailer ( objects -- str )
[
"startxref" ,
[ length 1 + ] map-sum 9 + "%d" sprintf ,
"%%EOF" ,
- ] { } make unlines ;
+ ] { } make join-lines ;
SYMBOLS: pdf-producer pdf-author pdf-creator ;
dup length [1,b] zip [ first2 pdf-object ] map ;
: objects>pdf ( objects -- str )
- [ unlines "\n" append "%PDF-1.4\n" ]
+ [ join-lines "\n" append "%PDF-1.4\n" ]
[ pdf-trailer ] bi surround ;
! Rename to pdf>string, have it take a <pdf> object?