GithubHelp home page GithubHelp logo

fpdf's Introduction

#FPDF.js

Create PDF-Files with Javascript in the Browser.

Have a look at a little Demo.

##Install

  1. Choose your favorite way to get FPDF.js

  2. Embed it into your HTML

     <script src="vendor/jspdf/dist/jspdf.min.js"></script>
     <script src="vendor/stdClass/stdClass.js"></script>
     <script src="vendor/fpdf/dist/fpdf.min.js"></script>
    
  3. Start creating PDF-Files in the Browser or read the Docs first... ;)

##Dependencies

FPDF.js depends on two JS-Tools

If you install FPDF.js with Bower the dependencies will be installed automatically.

##Hello World

var doc = new FPDF.Doc();

doc.css({
	padding:20
});

FPDF('div')
	.appendTo(doc)
	.text("Hello World")
	.css({
		fontSize:20,
		textAlign:'center'
	});

doc.save('Hello-World');

##Browser Support Tested in the following Browsers. I'd appreciate to get test-results of older browsers. @platdesign =)

  • Chrome (Version 34.0)
  • Firefox (28.0)
  • Safari (7.0.3)

##License This project is under the MIT license. Let me know if you'll use it. =)

##Contributors This is a project by Christian Blaschke. Get in touch: [email protected] or @platdesign

fpdf's People

Contributors

platdesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fpdf's Issues

bug on pageNumber when pageCount=1

There is a bug when the pageCount=0, even on example-1. Calling header.pageIndex() return 2 instead of 1.

var MyDoc = FPDF.Doc.extend({
            Page: FPDF.Page.extend({
                defaultCss:{
                    padding:[30,18,20,24],
                    lineHeight:1.4
                },
                header:function(){
                    this.css({
                            top:15,
                            fontSize:8,
                            textAlign:'right'
                        })
                        .text(Date);
                },
                footer:function(){
                    var header = this;

                    this.css({
                            top:280,
                            fontSize:10,
                            padding:1,
                            textAlign:'center'
                        })
                        .text(function(){
                            return 'Seite ' +
                                header.pageIndex() + 
                                ' von ' + 
                                header.pageCount()
                        })

                }
            })
        });

Pb with dist version of fpdf.js

When I've try to use the dist version, I've an error:
Uncaught SyntaxError: Unexpected token ( fpdf.js:1

But seems to work with min and bundle version.

Standard jsPDF API commands

It seems to not be possible to to use jsPDF API sush as to draw lines, etc.. Could you explains a way of using it if possible. By the way,Do you have an example to display an array with border or not, for exemple to write a simple pdf invoice rendering ?

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.