Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Effective PDF Generation in Drupal
Feb 03, 2015 @ 09:43:53

On the SitePoint PHP blog today there's a new post showing you how to create PDFs in a Drupal-based site making use of the Print module for the creation and formatting.

DF generation takes a slight change of mindset. As web developers, we have spent a lot of time convincing designers from a print background to stop producing pixel perfect designs that will be difficult to reproduce on the web. If you want to introduce PDF generation or any form of high designed print output, then we need to relearn some of our old skills we left behind. The nature of print means that it is precise and often needs pixel (or millimeter) perfect design.

He'd initially thought that the Views PDF module would be the natural choice, but after finding some unwanted dependencies, opted for the Print module instead. The Print module only creates the formatted output, though. This is then passed off to wkhtmltopdf to convert into final PDF form. He walks you through the configuration for the Print module and how to create some of the basic HTML structure for the resulting output. Next up is the addition of some styling and the process for exporting the HTML output over to wkhtmltopdf for handling. Output samples are included to help illustrate the final result.

tagged: pdf generation drupal tutorial views print wkhtmltopdf convert

Link: http://www.sitepoint.com/effective-pdf-generation-drupal/

PHPMaster.com:
Convert HTML to PDF with Dompdf
Aug 15, 2013 @ 10:39:16

On PHPMaster.com there's a new tutorial from Shameer C showing you how to use Dompdf to convert HTML to PDFs. The handy library makes it (relatively) simple to automatically generate the documents without the need to know the internal PDF file structure.

PDF is a standard format originally created by Adobe for representing text and images in a fixed-layout document. It’s not uncommon for a web application to support downloading data, such as invoices or reports, in PDF format, so in this article we’ll go through how we can easily generate PDF documents using PHP.

He starts off with the installation (via Composer) and the creation of a simple "Hello World" document, showing how to "stream" it into a PDF file. He also includes some more advanced usage - loading an external HTML, drawing lines, changing fonts, adding page numbers and additional text to the page.

tagged: html pdf convert tutorial dompdf adobe

Link: http://phpmaster.com/convert-html-to-pdf-with-dompdf

PHPMaster.com:
Extract Objects from an Access Database with PHP, Part 2
Jun 03, 2013 @ 10:37:24

PHPMaster.com has posted the second part of their series covering connecting PHP to a legacy Access database. In part one they introduced you to working with the data and how to extract the object. In this new part they look at specific file types and how to pull out their data.

In this second part we’ll learn how to extract Acrobat PDF documents and take a brief look at a selection of image formats. The only similarity that PDF, GIF, PNG, etc., have when stored in an Access database is that they are all wrapped in an OLE container consisting of a variable length header and trailer. As we shall see, the trailer can be ignored as it was with the package discussed in Part 1. The header is more useful, but doesn’t contain all the information we need.

They get into the details of the headers for each type of object and include screenshots of what they look like in a hex viewer. The code for the complete class is included in the post, making it easy to drop in and get started with your transition from database object to external file.

tagged: extract object access database tutorial series pdf image

Link: http://phpmaster.com/extract-ole-objects-from-an-access-database-using-php-2

Web & PHP Magazine:
May 2013 Issue - "Time Travel"
May 09, 2013 @ 13:23:53

The Web & PHP Magazine has officially released their latest issue - the May 2013 edition, "Time Travel".

You may already be familiar with Git, but did you know that it can rewrite time itself? GitHubber Ben Straub explains all in this month's issue, which also features tutorials on extracting XML data from RSS, using Composer to manage project dependencies and using the PHP Content Repository. If you've ever thought about starting a PHP user group, Atlanta PHP User Group co-organiser Kevin Roberts shares his secrets - plus, there's our regular columns on agile, big data and testing.

Articles included in this latest issue include:

  • "Change the Past" (Ben Straub)
  • "Why do User Groups?" (Kevin Roberts)
  • "Sprint Retrospective Primer" (Steffan Surdek)
  • "Urban Legends and Error Handling" (Stefan Priebsch)
  • "Managing your project's dependencies with Composer" (Jefersson Nathan de O. Chaves)

As always, this issue is available free of charge and can be downloaded directly from their site.

tagged: webandphpmagazine issue timetravel download pdf

Link: http://webandphp.com/May2013

Web & PHP Magazine:
Issue #10 - Reality Check
Jan 15, 2013 @ 11:27:09

The latest issue of the Web & PHP Magazine has been published - Issue #10. This issue can be downloaded for free and has articles about:

  • Building an Identity Extraction Engine in PHP (Jonathan LeBlanc)
  • 5 Deadly Programming Sins (Michael Stowe)
  • Physical Security Fail (Arne Blankerts)
  • Database Indexing (Cory Isaacson)

You can also download previous issues of the magazine for free after registering or logging in to your account.

tagged: webandphpmagazine issue publish reality check free download pdf

Link:

Web & PHP Magazine:
Issue #8 - The Power of Design
Nov 15, 2012 @ 13:55:06

The latest issue of the Web & PHP Magazine has been released - Issue 8 - The Power of Design. Articles in this latest issue include:

  • Todd Lombardo on user context
  • Stefan Priebsch on data and persistence
  • Patrick Allaert about data structures
  • June Henriksen on the human side of programming

You can find out more about this issue (and go download your free copy) on the Web & PHP site. There's also seven previous issues, all free for download (PDF format)!

tagged: webandphpmagazine issue publish design context structure human pdf

Link:

Wojciech Sznapka:
Export colored Behat scenarios to PDF
Sep 04, 2012 @ 09:42:49

Wojciech Sznapka has shares his technique for creating colorized exports of Behat tests for use in PDF files:

Behat scenarios are one of the best ways to describe system. UML Use Cases or tons of pages in SRS documents are fine, but hard to understand from the begining, and even harder to maintain in the future. Behat eases this process and also gives opportunity to automate requirements verification. To write Behat scenarios you need a text editor. I’ve picked my favourite – Vim, which highlights *.feature files syntax. But business people mostly don’t use Vim, so I need to figure a way, to expose scenarios in easy and pleasant way.

His solution involves setting up some printing options in vim to export the tests as a Postscript file, setting the "colorscheme" to the default setting so the colors will be retained. The result is exported (via the "hardcopy" command) and can be converted into a PDF (with a result like this).

tagged: behat test color export postscript pdf print

Link:

Fortrabbit.com:
BETA survey results
Aug 28, 2012 @ 11:19:54

Fortrabbit.com has conducted a survey of developers world-wide about what kind of platform, tools and software they use in their development work. They've posted the results to their site today, the answers from about 160 different developers.

We have asked our readers a few questions on their PHP workflows, hosting and tools. We are very curious about this, because we want to build the best PHP PaaS for dev guys.

Some of the highlights from their findings include the large share of Zend Framework use, the predominant use of git for deployment, MySQL still being the database of choice and multi-stage deployment (environments) are a preferred setup. You can see the full results here [pdf].

tagged: survey results paas developer pdf

Link:

Code2Learn.com:
Generating PDF files from Database using CodeIgniter
Feb 29, 2012 @ 12:07:33

On the Code2Learn blog there's a recent tutorial about creating PDFs from CodeIgniter using the R&OS PDF class (not bundled with the framework, but easy to integrate).

As a programmer I find PDF files very helpful to me when generating reports and getting them printed. We will be using R&OS pdf class. I find this to be the best one because all others libraries I came across didn't offer me a good control over the making of the file and also the process of making i.e the code required for this library is bit tricky but it helped me improve my coding.

Code is included to create a simple PDF helper class that creates a new "cezpdf" object and add some basic things like titles, page numbers and some basic footer text. A simple controller is included that pulls the information from a database table (in their case a record of logins) and pushes this data into the PDF as lines of text.

tagged: codeigniter framework pdf class helper pdf generate database

Link:

Code2Learn.com:
Generating PDF files from Database using CodeIgniter
Feb 29, 2012 @ 12:07:33

On the Code2Learn blog there's a recent tutorial about creating PDFs from CodeIgniter using the R&OS PDF class (not bundled with the framework, but easy to integrate).

As a programmer I find PDF files very helpful to me when generating reports and getting them printed. We will be using R&OS pdf class. I find this to be the best one because all others libraries I came across didn't offer me a good control over the making of the file and also the process of making i.e the code required for this library is bit tricky but it helped me improve my coding.

Code is included to create a simple PDF helper class that creates a new "cezpdf" object and add some basic things like titles, page numbers and some basic footer text. A simple controller is included that pulls the information from a database table (in their case a record of logins) and pushes this data into the PDF as lines of text.

tagged: codeigniter framework pdf class helper pdf generate database

Link: