Coder Social home page Coder Social logo

rodneyway / silverstripe-pdfrendition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nyeholt/silverstripe-pdfrendition

0.0 2.0 0.0 2.32 MB

A module that makes use of the Flying Saucer XHTML renderer project to create PDFs from XHTML pages

License: BSD 3-Clause "New" or "Revised" License

Scheme 5.31% JavaScript 6.51% PHP 78.09% CSS 10.09%

silverstripe-pdfrendition's Introduction

PDF Rendition Module

Maintainer Contact

Requirements

  • SilverStripe 3.0.X
  • Tidy (preferably the built in PHP tidy module, otherwise the commandline binary)
  • Java >= 1.5 installed on the SilverStripe server

Documentation

This module allows users to easily create complex PDF renditions of content by utilising HTML and CSS3 to define page layouts for printing. It provides a simple extension that adds a simple action for automatically generating PDF renditions of a page, and an API for developers to generate more specific PDF renditions.

Please see http://github.com/nyeholt/silverstripe-pdfrendition for more details about specific styling tips

Installation Instructions

  • Extract to your silverstripe folder in /pdfrendition

Usage Overview

  • Add Object::add_extension('Page_Controller', 'PdfControllerExtension'); to your _config.php
  • Add $PdfLink in your template to insert a link to the PDF version of the page
  • To customise the PDF layout, create a 'pdfrendition.css' file in your theme directory and add styles specifically for your pdf. See the github wiki for some examples of how to do some common PDF based things.

Known issues

Rendition Failures

Occasionally a page won't correctly render, throwing some kind of junk back to the browser as the PDF rendition process fails. Typically, this is caused by malformed XML being sent to the renderer; for this reason everything is first passed through HTML Tidy, however in some rare cases this can still not correctly convert the raw content.

In these cases, errors will be sent through to your error log files; it will indicate the temporary files that were created, so you should first check these for XML errors. If that does not work, you can also attempt to manually perform the conversion using commandline tidy and the commandline for the PDF rendition to see if there are more verbose errors available for debugging the problem.

silverstripe-pdfrendition's People

Contributors

nyeholt avatar

Watchers

Rodney avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.