Export Data from Rev to PDF format

Sarah Reichelt sarah.reichelt at gmail.com
Tue Jan 10 02:08:21 EST 2006


You have to save your text to a file, then send the convert command
the name of that file and the name of the pdf you want to create. Here
is another example:

    put specialFolderPath("Desktop") into tFolder
    put tFolder & "/Report.html" into tStartFile
    put the htmltext of fld "PrintField" into URL ("file:" & tStartFile)
    put tFolder & "/Report.pdf" into tEndFile
    put "/System/Library/Printers/Libraries/convert" into tConvertApp
    get shell(tConvertApp && "-f" && tStartFile && "-o" && tEndFile &&
"-j application/pdf")

I have a field called "PrintField" that has a report formatted as I
want it with text sizes and styles. I save the html text to a file on
the desktop called "Report.html". Then I use Ken's script to create a
pdf file called "Report.pdf".

I should delete the temporary html file after that and just look at
the pdf. I used the htmltext but you can just use plain text. I don't
know what will happen with font character mapping - maybe using HTML
or RTF will cover that.

There must be an explanation of the parameters for this convert
command somewhere, but I haven't been able to find it. There are two
example scripts that use it in the AppleScript menu and the other one
convert to postscript by changing the last bit of the command to:
 -j \"application/postscript\"

Hope this helps,
Sarah


On 1/10/06, Sivakatirswami <katir at hindu.org> wrote:
> OK I see this:
>
> ====
> on mouseUp
>    answer file "Select a file:"
>    if it is not empty then
>      put it into tSrcPath
>      put tPath & ".pdf" into tDestPath
>      put "/System/Library/Printers/Libraries/convert" into tConvertApp
>      get shell(tConvertApp && "-f" && tSrcPath && "-o" && tDestPath &&
> "-j application/pdf")
>    end if
> end mouseUp
>
> HTH,
> Ken Ray
> ======
>
> I think I am missing some key elements such as what acceptable file
> formats are there for tSrcPath?
>
> If the source data is plain ASCII but to be rendered in a different,
> foreign font with a char-to-glyph mapping other than plain roman...?
>
> is that a .ps file in tSrcPath?
>
> Sivakatirswami
>
> On Jan 08, 2006, at 8:21 PM, Sarah Reichelt wrote:
>
> >> Has anyone done a small lib to export rev data (unadorned text will
> >> be fine) to a PDF file?
> >>
> >> Most of my in house RAD's involve some kind of document-text work.
> >> I'm doing a stack now that handles translation and transliteration in
> >> Tamil and English and to get a PDF I have to export XML, import into
> >> inDesign and then export as PDF.
> >>
> >
> > Is it all done on OS X? Because if so, you can use the convert shell
> > command. Ken Ray gave an example of how to do this on the list a while
> > ago: <http://lists.runrev.com/pipermail/use-revolution/2005-March/
> > 053431.html>
> >
> > HTH,
> > Sarah
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list