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

Janeks
23-Oct-2005
[39x2]
I am interested to understand format of metrics definition blocks. 
Is it possible to use them to get language specific characters correctly 
displayed?
Are there any short documentation/description how to use pdf-tables.r?
Gabriele
24-Oct-2005
[41]
1) no; 2) no. Sorry. Supporting other charsets requires changes to 
the code AND to the font metrics data. About pdf-tables, never got 
to document it at all. i don't have any simple example either, except 
from some i provided here or on the ml long time ago.
Janeks
24-Oct-2005
[42]
Thanks for anwers!

I don't know any thing about PDF, but I did couple functions for 
encoding conversation.

Could it be a "quick hack" or it requires good background of PDF 
format ?
Gabriele
25-Oct-2005
[43]
it might be a quick hack, but i need to check the docs for PDF... 
but IIRC for an encoding different from the default you need to provide 
a char table or something like that...
Janeks
25-Oct-2005
[44]
It is probably a bit funny, but I used to put both of following head 
part in my HTML pages:

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1257">

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-10">

It worked so that it was corectly displayed in M$ Exploer and Opera.

The Baltic Rim ( "Windows Baltic Microsoft code page – cp 1257") 
is the standart.

I will send to your e-mail couple of images with characters and codes.
Oldes
22-Feb-2006
[45]
Would it be possible to use PDF-maker to extract just a pure text 
from PDF files?
JaimeVargas
22-Feb-2006
[46]
I think PDF-makes is a generator not a parser.
Oldes
22-Feb-2006
[47x2]
I know, I was just thinking, if it's easily possible to use it as 
a PDF decoder, but will rather use this http://sourceforge.net/projects/pdftohtml/
and then use Rebol to parse the HTML
hm, Copying of text from this document is not allowed. :(
JaimeVargas
22-Feb-2006
[49]
Probably it has some level of security. PDF has a layered system 
of rights.
Oldes
22-Feb-2006
[50]
So I have to recompile the sources:-)
Henrik
9-Mar-2006
[51]
http://www.lerup.com/printfile/<--- would this be a good way to 
print PDFs easily from rebol under windows?
Ryan
11-Mar-2006
[52]
Can it print graphics?
Henrik
11-Mar-2006
[53]
haven't tried (don't have a printer), but if it can print postscript, 
then it can print graphics
Ryan
12-Mar-2006
[54x2]
I suppose my question should be: Can it print graphics easily? I 
want something like >>printout %//pc/printer to-image layout [title 
"TEST PRINT"]
I  can do this pretty much with html, or PDFmaker with acrobat version 
x, but I would a more exact publicly usable solution.
Henrik
13-Mar-2006
[56]
I don't think you can do that 100% within rebol, but Printfile seems 
to let you spool PS from a watched directory. Store a PDF or PS file 
in that specific directory and it will be printed. Printfile can't 
run as a service or in the background it seems.

It's easier under Linux where you can employ PDF2PS and just feed 
it to LPR, which will then print it.
Anton
13-Mar-2006
[57]
Henrik did you try using SRVANY.EXE ? (runs any program as a service).
http://support.microsoft.com/kb/q137890/
Henrik
13-Mar-2006
[58]
that's very interesting... does anything like that exist for windows 
98?
Ryan
13-Mar-2006
[59x2]
What is printfile?
Duh, nevermind, already checked it out.
Anton
15-Mar-2006
[61]
I'm not sure about win98.
Graham
3-Apr-2006
[62x4]
Just wondering if it's possible to combine an existing pdf with the 
pdf-maker.  What I need to do is draw over an existing pdf....
I'd like somehow to plot a child's growth over the top of a pdf such 
as this.
http://www.cdc.gov/nchs/data/nhanes/growthcharts/set1clinical/cj41l017.pdf
I'd hate to have to redraw this in the plot dialect just to stick 
a few points on it.
Gabriele
3-Apr-2006
[66]
it is possible, but not trivial; you don't actually need to change 
the pdf file, just append to it; however you need to parse it to 
do this correctly.
Graham
3-Apr-2006
[67]
So, given such a pdf, all I have to do is figure out where to put 
the 0, 0 and the scale, and try plotting to it?
Gabriele
3-Apr-2006
[68x8]
well, basically updating a pdf works this way:
the reader looks at the end of the file (except for linearized format, 
but this should not worry you right now) for the xref
the xref contains the location in the file of any pdf object (such 
as pages, fonts, and so on)
the xref might just be an update to an older xref present earlier 
in the file
in this case, it only contains references to changed objects, and 
to the old xref
each object has an id and a generation number; the generation number 
must be incremented when you update the object, that is when you 
append a new object to the file that should actually replace the 
old
so if page 1 has id 123 (for e.g.) and generation 1, you can append 
an object with id 123 and generation 2 to replace the original page 
object that comes earlier in the file
you need to provide a new xref for this new object and referring 
to the old xref
Graham
3-Apr-2006
[76]
And this is not trivial?
Gabriele
3-Apr-2006
[77x3]
so what you need to do is: 1) determine what objects need to be replaced 
2) append their replacements to the file 3) append new xref
it depends on the source pdf file
because you need to parse it to figure out what objects need to be 
updated and how
Graham
3-Apr-2006
[80]
this one contains a lot of binary
Gabriele
3-Apr-2006
[81]
stream objects are usually compressed; so you may need to decompress 
them too
Graham
3-Apr-2006
[82x2]
So, this is what is done by programs that annotate pdfs?
Or, is that different?
Gabriele
3-Apr-2006
[84x2]
if you are lucky and the source pdf has a simple structure, and all 
your source pdfs have the same structure, then this might be very 
easy
yes, except that annotations are separate objects so it's somewhat 
easier
Graham
3-Apr-2006
[86]
And this is all automated in pdf-maker2 ?  :)
Gabriele
3-Apr-2006
[87x2]
nope :P and won't be for pdf maker 2 either. but you can use the 
code in the pdf maker to generate the objects and the xref
(the xref generator in the pdf maker only works for the main xref 
of the file, not the change xrefs, but it should be easy to change 
it to generate a change xref)