From a0a43ac399a7b5313eecd9911f02c8dbdd8d4d6a Mon Sep 17 00:00:00 2001 From: Carl Wright Date: Mon, 29 Mar 2010 23:55:18 -0400 Subject: [PATCH] Added documentation on the minimum steps to create a one page PDF; removed un-needed code in eg_test6.erl --- doc/minimal_pdf.md | 41 +++++++++++++++++++++++++++++++++++++++++ test/eg_test6.erl | 4 ++-- test/eg_test6.pdf | Bin 1023 -> 1023 bytes 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 doc/minimal_pdf.md diff --git a/doc/minimal_pdf.md b/doc/minimal_pdf.md new file mode 100644 index 0000000..5e2fed6 --- /dev/null +++ b/doc/minimal_pdf.md @@ -0,0 +1,41 @@ +A Mininal PDF Contruction +========================= + +The following code id the minimum you need to create a one page PDF +with calls to the pdf module. + +### PDF = pdf:new(), + +To create a pdf into which to put content + + +### pdf:set_pagesize(PDF,a4), + +To set the page size of the PDF. Other choices are letter, legal, lots of A formats and B formats. + +### pdf:set_page(PDF,1), + +To set the page you are working on + + +### pdf:set_font(PDF, "Victorias-Secret", 40), + +To set the font to use until told different + +### pdf_lib:moveAndShow(PDF, 50, 700, "Hello Joe from Gutenburg"), + +To move to position (50,700) and place the "Hello Joe from Gutenberg content" + +### Serialised = pdf:export(PDF), + +To create all the content of the pdf as a string in the term Serialised + + +### file:write_file("../test/eg_test6.pdf",[Serialised]), + +To output the pdf content into a finsihed PDF file + + +### pdf:delete(PDF). + +To delete the PDF object and process. \ No newline at end of file diff --git a/test/eg_test6.erl b/test/eg_test6.erl index 39166ac..3a2fd0f 100644 --- a/test/eg_test6.erl +++ b/test/eg_test6.erl @@ -27,8 +27,8 @@ %% ===================================================================== -module(eg_test6). --import(pdf_op, [n2s/1]). --import(pdf_lib, [showGrid/2, moveAndShow/4]). + +-import(pdf_lib, [moveAndShow/4]). -export([test/0]). diff --git a/test/eg_test6.pdf b/test/eg_test6.pdf index d401f640b1f2d22e2d90ac9b4f857d6f82247d24..9288737ea5e578f5c4740bddca403056260a0943 100644 GIT binary patch delta 20 bcmey*{-1qAKNGv9k+G?