Skip to content

Commit

Permalink
Added documentation on the minimum steps to create a one page PDF; re…
Browse files Browse the repository at this point in the history
…moved un-needed code in eg_test6.erl
  • Loading branch information
CarlWright committed Mar 30, 2010
1 parent 834ccf1 commit a0a43ac
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions doc/minimal_pdf.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions test/eg_test6.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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]).

Expand Down
Binary file modified test/eg_test6.pdf
Binary file not shown.

0 comments on commit a0a43ac

Please sign in to comment.