Groff For Mac

  суббота 25 апреля
      49

I need to automate PDF document generation and have looked at a number of options for doing this from a PHP enabled web site. The basic problem is that for machine-generated documents, it's easiest to work with text files, but for documents that end up in PDF format with headers, footers, and graphics, a word processor is easiest.

Design Portfolio of Graphic Designer, Candace Groff. The best software comes from the best open source places, and this is a crystal reports editor open source is available from Source Forge, and is brought to you by a group of people and is available for free to download. One of the cool crystal reports editors available for Mac, Windows, and Linux operating systems. Crystal Reports Viewer.

Right now I use AppleScript to control Appleworks, but this means I have an Appleworks template, an AppleScript, I then edit a bit, and print to PDF. I have other processes that could benefit from automatic PDF generation, but generating the commands to drive the PDF creation is a bit complex. I want to be able to just generate a text file and have it become a nice PDF.I ended up looking at TeX and LaTeX, but downloads were huge, a build I needed to do didn't work, and I couldn't get the complex software to work.Then I stumbled on the standard groff. I had thought it was just for generating decent looking monospaced ASCII for a terminal. How wrong I was. This is a fully featured typesetting program on par with TeX. Special herbs the box set vol. 0 9 rar. It takes plain ASCII text and generates beautiful, typeset output.

There are resources called macro packages that allow complex editing tasks to be done.Here are some examples of how it may be used - these are for use in the Terminal:Want to print up a hard copy of a man page? Groff -l -mandoc `man -w apachectl` will give you the apachectl man page.Want a postscript file of the groff man page that is then opened in Preview?$ groff -mandoc x.ps `man -w groff`$ open x.psHow about a system that will typset a manuscript? There is a document processing system called mom. It is a set of commands to groff that resides in what is called a macro file. Create a text file called x.txt and fill it with the following.TITLE 'MacOSXHints'.SUBTITLE 'A Fine Source of Hints'.AUTHOR 'Your Name'.PRINTSTYLE TYPESET.blm PP.STARTHere is a fine first paragraph.Here is the second.Here is the third.Then typeset it and open in Preview:$ groff -mom x.ps x.txt$ open x.psWell, not earth shaking, but any text you want to look at is now typeset as a Postscript document.

Just put the paragraphs as separate chunks of text separated by blank lines.The benefit of this is that if you want to generate PDF's programmatically, all you have to do is write a text file, easy from most any program, to a file x.txt and then invoke:groff -mom x.txt pstopdf -i -o x.pdfThis uses the pstopdf utility to create file x.pdf from x.txt. You want PDF's of man pages? An exercise for the reader.And groff has great documentation, already on your computer.

Note that your submission may not appear immediately on our site. Support First Time Setting Up? Was this review helpful? D-Link DWL-G 54Mbps TechRadarThe posting of advertisements, profanity, or personal attacks is prohibited. D link wireless dwl g122 drivers for mac.

Look in /usr/share/doc/groff/ and open the folder there (1.19.1 or 1.19.1 or something like that). Go into each folder and find the intro.html file. As an example:/usr/share/doc/groff/1.19.1/html/momdoc/intro.htmlContains an introduction to mom.Also, the groff man page is good, as are the roff and troff manpages. Yeah, it is a bit of reading, but it is much easier to use than TeX and LaTeX, and it is already on your system, ready to go.What I will be doing is using groff to generate automatic reports from PHP. Just have to emit some text to a file and execute the shell command for PDF creation.

robg adds: I haven't tested this one, and we've on a few occasions before. As someone who has been using.roff since about 1976 (first roff, under V6 UNIX, then nroff/troff, then ditroff, then MKS/SoftQuad sqroff, then groff under BSDI and FreeBSD and now under MacOS/X), it warms my heart to see that the program continues to live on and have value.One of the most useful features in the.roff family is the set of filters that exist for it.

These are aimed at tables (tbl), equations (eqn), figures (pic), graphs (grap), and references (refer). There are also macro packages that may have value to some other than -mom and -man, such as -ms, which is probably the oldest, widely-used package, and -me, which was designed for typesetting dissertations.

Finally, for those who are inclined towards programming, it can be very useful to use make(1) to manage all the pieces, filtering, and transformations in a longer groff document.There are weaknesses with.roff in today's environment, chiefly the fact that it doesn't directly support output formats that are currently portable, such as.rtf and.pdf (you can get to.pdf from.ps as in the hint and also in various other ways, but the current.rtf translators are unacceptable). The problem is that some journals require either.doc or.rtf for manuscripts. However, there are other output formats that are supported, see groff(1).Greg Shenaut. I forgot where I got this from, but a better way too open man pages in Preview.app is this script#!/bin/bash if $# -eq 0 # '$#' is number of parameters- here we test whether it is not equal to 0 then echo 'Usage: $0.' # not one parameters # so print message exit 2 # and fail ($0 is # name of command). Fi man -t $1 pstopdf -i -o /tmp/$1.pdf open -a /Applications/Preview.app /tmp/$1.pdf ( sleep 60; rm -f /tmp/$1.pdf) &Call it pman, make it executable, put it in the $PATH, and just type'pman nameofunixapp'in the terminal and it will open it up in Preview. I've been using a script I call 'pipegv' to look at postscript output from groff without translating it to pdf: #!/bin/shif '$1' = ' ; then T=/tmp/pipgv.$$ trap 'rm -f $T' EXIT INT cat $T gv $Telse gv $.fiThis reads postscript from standard input into a temp file, calls gv on the temp file, and then removes it when gv exits.

Groff For Mac

Gv runs under X-windows, so you have to have that running to use it. There is a program called xditview which is supposed to preview groff output, but I've never been able to get it to work right.Greg Shenaut. Groff is a fun and easy typesetting utility. If you don't like to use postscript you can also bring in documents in many other formats.However, if you are generating PDF's from scratch using PHP, a better and more portable alternative to using external commands may be to use the excellent FPDF library at www.fpdf.org. It's writtin in pure php and is very capable when generating PDF's.

The license terms are also very accomidating (vs libpdf especially). Even if PHP is not your thing, there are bindings for some other languages too (though they still require that PHP be installed). I appreciate your comment. I had looked at FPDF.

It is a very good choice for a document where items are placed in various places on the page. It was a little cumbersome, however, for just flowing out long paragraphs of wrapped text.

For simple text to a PDF the simple workflow that could be had with groff was a real plus. Also, the source file generated by PHP in this workflow was saveable as a draft version, so later editing of the text file was an option in the groff based workflow, but wouldn't be with the FPDF workflow.I agree about FPDF being the best tool for PDF generation out of PHP in general, though.-Steve Holland.