CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sat, 09 Aug 2025 10:16:40 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100706132443
location: https://web.archive.org/web/20100706132443/https://github.com/Marak/pdf.js/
server-timing: captures_list;dur=0.946837, exclusion.robots;dur=0.042627, exclusion.robots.policy;dur=0.020154, esindex;dur=0.020016, cdx.remote;dur=90.298742, LoadShardBlock;dur=311.532201, PetaboxLoader3.datanode;dur=91.998758, PetaboxLoader3.resolve;dur=91.453157
x-app-server: wwwb-app224
x-ts: 302
x-tr: 457
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app224; path=/
x-rl: 0
x-na: 0
x-page-cache: BYPASS
server-timing: BYPASS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
x-location: _pdf
HTTP/2 200
server: nginx
date: Sat, 09 Aug 2025 10:16:41 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Tue, 06 Jul 2010 13:24:43 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "6e50d018d7a84e7cf463b8b62981f7e7"
x-archive-orig-x-runtime: 56ms
x-archive-orig-content-length: 24216
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 06 Jul 2010 13:24:43 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Tue, 06 Jul 2010 13:24:43 GMT", ; rel="memento"; datetime="Tue, 06 Jul 2010 13:24:43 GMT", ; rel="next memento"; datetime="Fri, 25 Feb 2011 04:21:31 GMT", ; rel="last memento"; datetime="Tue, 18 Feb 2025 19:04:34 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_16_20100706104557_crawl100-c/52_16_20100706132431_crawl101.arc.gz
server-timing: captures_list;dur=0.844145, exclusion.robots;dur=0.030927, exclusion.robots.policy;dur=0.011876, esindex;dur=0.020208, cdx.remote;dur=21.966178, LoadShardBlock;dur=271.891506, PetaboxLoader3.datanode;dur=106.995190, PetaboxLoader3.resolve;dur=257.154038, load_resource;dur=132.278118
x-app-server: wwwb-app224
x-ts: 200
x-tr: 483
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-rl: 0
x-na: 0
x-page-cache: BYPASS
server-timing: BYPASS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
x-location: _pdf
content-encoding: gzip
Marak's pdf.js at master - GitHub
Marak / pdf.js
- Source
- Commits
- Network (5)
- Issues (1)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
pdf.js /
name | age | message | |
---|---|---|---|
![]() |
Readme.md | Sun Jun 20 01:43:33 -0700 2010 | pdf.js has been succesfully updated, tested, an... [Marak] |
![]() |
index.html | Fri Jul 02 18:54:53 -0700 2010 | created vendor folder, bumped to version 0.2.1 [Marak] |
![]() |
lib/ | Fri Jul 02 18:54:53 -0700 2010 | created vendor folder, bumped to version 0.2.1 [Marak] |
![]() |
node-demo.js | Wed Jun 16 22:11:16 -0700 2010 | updating examples, bundling lib [Marak] |
![]() |
package.json | Fri Jul 02 18:54:53 -0700 2010 | created vendor folder, bumped to version 0.2.1 [Marak] |
![]() |
vendor/ | Fri Jul 02 18:55:01 -0700 2010 | created vendor folder, bumped to version 0.2.1 [Marak] |
Readme.md
pdf.js - create basic pdf files in the browser or node.js, simple as cake
online demo @ https://maraksquires.com/pdf.js/
USAGE
browser -
<script src = "./lib/pdf.js" type = "text/javascript"></script>
<script>
/* create the PDF document */
var doc = new pdf();
doc.text(20, 20, 'hello, I am PDF.');
doc.text(20, 30, 'i was created in the browser using javascript.');
doc.text(20, 40, 'i can also be created from node.js');
/* Optional - set properties on the document */
doc.setProperties({
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
});
doc.addPage();
doc.setFontSize(22);
doc.text(20, 20, 'This is a title');
doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');
var fileName = "testFile"+new Date().getSeconds()+".pdf";
var pdfAsDataURI = doc.output('datauri', {"fileName":fileName});
/* inject the pdf into the browser */
// inject using an iframe
// this seems to work in FF but not Chrome? try testing some more on your own >.<
//$('#theFrame').attr('src',pdfAsDataURI);
// inject using an object tag
// doesnt really work but it does something interesting
//$('body').append('<object data="'+pdfAsDataURI+'" type="application/pdf"></object>');
// inject changing document.location
// doesn't work in FF, kinda works in Chrome. this method is a bit brutal as the user sees a huge URL
// document.location = pdfAsDataURI;
// create a link
// this seems to always work, except clicking the link destroys my FF instantly
$('#pdfLink').html('<a href = "'+pdfAsDataURI+'">'+fileName+'</a> <span class = "helper">right click and save file as pdf</span');
</script>
node.js -
var sys = require('sys');
var fs = require('fs');
var pdf = require('./lib/pdf').pdf;
/* create the PDF document */
var doc = new pdf();
doc.text(20, 20, 'hello, I am PDF.');
doc.text(20, 30, 'i was created using node.js version: ' + process.version);
doc.text(20, 40, 'i can also be created from the browser');
/* optional - set properties on the document */
doc.setProperties({
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
});
doc.addPage();
doc.setFontSize(22);
doc.text(20, 20, 'This is a title');
doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');
var fileName = "testFile"+new Date().getSeconds()+".pdf";
fs.writeFile(fileName, doc.output(), function(err, data){
sys.puts(fileName +' was created! great success!');
});
Authors
Marak Squires and Matthew Bergman
Heavily inspired by James Hall's jsPDF