1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

PDF

From podhawk

Jump to: navigation, search

Contents

Introduction

Podhawk 1.81 and later releases contain a new version of a PDF plugin. This plugin places a PDF icon or a text link below each posting. Clicking on the icon or link will download a PDF file containing the text of the posting concerned, including any images in the posting.

The options for the plugin include the title ('strapline') which will appear at the top of the PDF; an image which will appear at the top left of the PDF page; and text which will appear at the bottom of the page. You can specify a colour for the text in the header, and a font for the body of the PDF. You can choose whether to place the PDF download link below the text of each posting, or elsewhere in the postings loop.

Caching PDFs

If you create a directory 'pdf' in the root of your PodHawk site, the plugin will cache copies of PDFs as it makes them. This means that the programme needs to create each PDF only once, when it is first requested. After that, it simply downloads the cached version. If you click 'save' on Recording page 2, this will clear any cached PDF for that posting, so that a new PDF can be created containing any changes which you have made to the posting text. The plugin will not be able to cache PDFs unless PHP can write to the 'pdf' directory. If PHP on your server runs under CGI/FastCGI, or if you have a Windows server, this should not be a problem. Where PHP runs as an Apache module, and you have entered your FTP details in the admin Settings page, PodHawk will automatically make the pdf directory writable when it needs to cache a new PDF. Otherwise, you will need to change the permissions on the pdf directory to 0777.

Adding additional fonts

The plugin contains a selection of both serif and non-serif fonts. The Times, Arial and Courier fonts support only western European characters. The DejaVu and Liberation fonts also support Cyrillic and Greek characters.

If you want your PDF to contain other characters sets, you need to find a UTF-8 TrueType font (a "unifont") which supports the characters you need. For example, if you want to use Lao characters, you might use the Phetsarath font. Upload a ttf (TrueType font) file containing the font you need to the directory podhawk/custom/plugins/pdf_maker/font/unifont. Then, on the plugin page for the PDF plugin, enter the name of the file you have loaded to the unifont directory (eg 'Phetsarath_OT.ttf'), and click 'save'.

If you want to use bold or italic characters in a font which you have uploaded, you also need to locate ttf files with the bold, italic and bold+italic characters that you need. These files need to have names which allow PodHawk to identify them as linked to your main font file. So, if your main font file is Myfont.ttf, the bold characters need to be in a file 'Myfont-Bold.ttf', the italic characters in 'Myfont-Oblique.ttf' and the bold/italic characters in 'Myfont-BoldOblique.ttf'. You may need to change the names of your font files to fit this pattern. If the plugin cannot find the Bold, Oblique and BoldOblique files, it will print all characters in normal style.

Images

The plugin will incorporate any images in the text of your posting into the PDF, provided that the <img> tags on your web page contain both height and width attributes. If you use the PodHawk image manager to create image HTML for you, PodHawk automatically creates these attributes; otherwise, you may have to add them by hand.

Personal tools