r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[PDF-Maker] discuss Gabriele's pdf-maker

Gabriele
3-Apr-2006
[91]
depending on how much you need to parse the original file, you may 
need to just read a few pages, or learn the whole spec
Graham
3-Apr-2006
[92]
Would it be easier to convert the pdf to postscript and then add 
the necessary ps commands??
Gabriele
3-Apr-2006
[93x2]
probably yes.
since ps doesn't have a structure like this
Graham
3-Apr-2006
[95x2]
I might have a go that way then.
now, all I have to do is learn a bit of PS :)
Gabriele
3-Apr-2006
[97]
it depends a lot on your source files. it may be easier with pdf 
if you don't need to parse much, otherwise if you need to you could 
need to implement decompression and so on.
Graham
3-Apr-2006
[98x2]
presumably pdf2ps does the decompression
I wonder if pdf2ps also extracts out protected pdf text ?
Gabriele
3-Apr-2006
[100]
i never tried. in principle it could.
Graham
3-Apr-2006
[101x5]
finally located ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.01pl2-win32.zip
which is xpdf,and contains pdftops.exe
I converted my pdf to postscript.  So, perhaps all I need to do is 
to insert my PS commands before the "showpage" near the end of the 
ps file, and recompile back to pdf ?
That worked sort of.
I got my "Hello World" at the bottom of the page, bottom left.  But 
the pdf which was originally one page, now has a second blank page.
Which makes me wonder if we shouldn't have a ps-maker dialect.
Thør
4-Apr-2006
[106]
.
Graham
5-Apr-2006
[107]
Having done a few graphs now in postscript, and it seems fairly easy 
to do .. make be those expert in dialects could look at constructing 
a postscript dialect.  This makes for great output, and potentially 
seems easier to do than creating pdfs.
Henrik
5-Apr-2006
[108x3]
easier? I thought pdf was a simpler subset of pdf?
sorry, subset of postscript
btw. on the compression issue, is it possible to decompress pdf streams 
inside rebol if they are properly massaged? I thought of building 
template pdf files, where you could search/replace the text inside 
those streams to make new pdfs
Gabriele
5-Apr-2006
[111]
henrik, ps is definitely easier to emit. too bad windows has no support 
for it out of the box.
Henrik
5-Apr-2006
[112x3]
interesting
I've always wanted to build a postscript emitter for REBOL. This 
would solve many problems in the printing area.
it would be cool if you could take a DRAW block and convert that 
to postscript
Gabriele
5-Apr-2006
[115x2]
that shouldn't be hard. actually, being that ps is forth, once you 
code the functions you need it's almost a 1:1 translation
(gradients may be the hard part)
Henrik
5-Apr-2006
[117]
well, if lines, curves, text and general paper size handling could 
be done first, that would be a very good thing
Gabriele
5-Apr-2006
[118]
text is a different issue, you need to do the typesetting yourself, 
and you eventually need to handle fonts.
james_nak
5-Apr-2006
[119]
Gabriele, just tried out pdf-maker for the first time yesterday. 
Very nice and quite useful.
Gabriele
5-Apr-2006
[120x2]
for the typesetter, the one i'm designing for pdf maker 2 could be 
easily reused (based on TeX, and i will write it as a RLP so you'll 
have full docs)
james, i'm glad it's useful :)
Henrik
5-Apr-2006
[122x3]
it is indeed very useful
but it would be even more useful if we could emit postscript directly 
from code.
would you mind if I made a group that would focus on the challenges 
in such an effort?
Joe
1-Jun-2006
[125x2]
I have to design a complex form with lots of boxes and text. Is there 
a dialect to define that ? thxs
Gabriele, will you have a pdf-maker 2 alpha ?
Gabriele
2-Jun-2006
[127x2]
Joe: I have no ETA yet.
btw, I just fixed a bug with the View 1.3 version of the pdf-maker 
and images.
Joe
2-Jun-2006
[129]
thanks. Gabriele, you specify A4 with as 211mm but it is 210mm http://www.cl.cam.ac.uk/~mgk25/iso-paper.html
Gabriele
3-Jun-2006
[130]
i got the number somewhere - i don't remember where, though. maybe 
they where converting back from inches and so had an error?
Anton
4-Jun-2006
[131]
The reason for magic numbers must be written down, even if it's just 
; I'm not sure about this number
PeterWood
4-Jun-2006
[132]
The reason is in the document of which Joe gave the URL two messages 
ago. It's all to do with the square root of 2.
Gabriele
5-Jun-2006
[133]
tolerance seems to be +/- 2mm, so 211 is still acceptable. i'll fix 
it in the future though.
Joe
7-Jun-2006
[134x2]
I just printed a PDF doc and it shows 3 different measures: 1) the 
preview window shows 210,02 x 297,01 2) Document: 211,0 x296,7 and 
3) Paper: 209,9x296,7 Weird!
So maybe PDF uses 211 for the doc but assumes the paper is 210 ?
Janeks
29-Jul-2006
[136]
Why I am getting this error?
>> do %pdf-maker.r
Script: "PDF Maker" (2-Jun-2006)
>> layout-pdf [[textbox ["This is some text."]]]
** Script Error: Cannot use add on none! value
** Where: make-pages
** Near: pid: (2 * length? pages) + i
foreach
>>
Gabriele
30-Jul-2006
[137x2]
hmm, anything unusual in your user.r file?
also, what version of REBOL?
Janeks
31-Jul-2006
[139]
REBOL/View 1.3.50.3.1 14-Oct-2005 Core 2.7.0
Copyright 2000-2005 REBOL Technologies.  All rights reserved.
REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM
>> change-dir winpath-to-file "C:\rebol\scripts\pdf_maker"
== %/C/rebol/scripts/pdf_maker/
>> do %pdf-maker.r
>> myLayPdf: layout-pdf [[textbox ["This is some text."]]]
** Script Error: Cannot use add on none! value
** Where: make-pages
** Near: pid: (2 * length? pages) + i
foreach
>>
Gabriele
1-Aug-2006
[140]
any reason why you are using 1.3.50? also, that winpath-to-file shows 
you do have something in user.r ;) anything you may be accidentally 
overwriting? (btw, rebol has TO-REBOL-FILE as native, so no reason 
to define your own)