[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pdfmark and fonts

From: Tristan Williams
Subject: pdfmark and fonts
Date: Wed, 20 Jun 2012 17:06:45 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hello Jeff and Ludovic,

Thank you for emails. 

I apologise for my lack of precision regarding @InitalFont and
@CurrFamily. The current font is what I really wanted. 

My aim is to be able to produce PDF versions of various hardcopy forms
I have created in Lout, but without having to use any additional
software packages.

I wanted the current font to pass to the pdfmark code that I have put
in the left argument to the @Graphic which I then put inside a Lout
function. If I leave out the /DA line from the pdfmark code (below)
the default (Postscript?) font used does not seem to be the same one
as the current font in Lout. So far, I have not been able to pass
successfully any element of Postscript's currentfont to/through the
pdfmark. I just don't know enough to do it yet!

Running the code below though Lout and then Ghostscript gives me a pdf
file with (simple) editable fields. Preview and AdobeReader can both
open the file, but sadly seem to interpret the fields and their
defaults slightly differently. 

Any and all suggestions and improvements welcome.

Kind regards,



def @edit
left  varname                 # pdf form variable name
named @font     address@hidden # current Lout font family. To work this must = 
Postscript font name
named @fontsize {12}          # default font size (points)
named @width    {2i}          # pdf edit box default width (2i)
named @bgcolour {[1 1 1]}     # pdf edit box default background colour (white)
named @fgcolour {0 0 0}       # pdf edit box default foreground colour (black) 
right default                 # pdf default value for field
0.5f @VShift {
gsave 0 0 moveto xsize 0 lineto stroke grestore
[ "/"Subtype "/"Widget
    "/"Rect [0 0 xsize ysize]
    "/"F 4
    "/"T (varname)
    "/"FT "/"Tx
    "/"DA ("/"@font @fontsize Tf @fgcolour rg)
    "/"V (default)
    "/"MK <<
    "/"BG @bgcolour >>
"/"ANN pdfmark


  @InitialFont{Courier Base 12p}
@Text @Begin
This is a sample form @DP
Name |1c name @edit{Your name}      |0c /1f
Age  |1c  age @edit{in whole years} |0c /1f @LLP
and changing the parameters etc... @DP
My favourite colour is blue @edit @font{Helv} @fgcolour{1 0 0} @bgcolour{[0 1 
0]} @width{1c} {blue} like the sea. 

@End @Text

reply via email to

[Prev in Thread] Current Thread [Next in Thread]