Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6ccaaff
remove stream extension from reference
CorvusCorrax Sep 8, 2017
f19b455
Fix font
CorvusCorrax Sep 8, 2017
fd4392d
Use buffer instead of multiple writes
CorvusCorrax Sep 13, 2017
98c4489
use buffer concat only once
CorvusCorrax Sep 19, 2017
797a160
Create embed tag name using a deterministic algorithm based on font id
blikblum Aug 7, 2018
569b53f
Add integration tests (check for generated pdf). Covers examples dist…
blikblum Aug 8, 2018
d75fdea
Add tests for tables, watermark and qrcode pdfmake demos
blikblum Aug 8, 2018
9e5b9a3
Remove tests dir from .gitignore
blikblum Aug 11, 2018
8e1aae2
Implement saving pdf files when test snapshot is updated/added. Write…
blikblum Aug 11, 2018
e101e47
Do not compress pages
blikblum Aug 12, 2018
9d7a1b7
Fix removing changed pdf
blikblum Aug 12, 2018
81e1dd8
Add eslint dependency
blikblum Aug 12, 2018
aac4065
Extract PDFFont.open class method to PDFFontFactory to break circular…
blikblum Aug 13, 2018
716ae74
Break circular reference between PDFObject and PDFReference
blikblum Aug 13, 2018
fed0e5c
Merge memory leak fixes (PR #729)
blikblum Aug 18, 2018
0449871
Update test snapshots
blikblum Aug 18, 2018
9067903
decaffeinate: Rename abstract_reference.coffee and 24 other files fro…
blikblum Aug 18, 2018
d4f32d2
decaffeinate: Convert abstract_reference.coffee and 24 other files to JS
blikblum Aug 18, 2018
2018e2b
decaffeinate: Run post-processing cleanups on abstract_reference.coff…
blikblum Aug 18, 2018
b4dba45
Fix import issues and remove constructor hack
blikblum Aug 18, 2018
e61498f
Do not try to set length property of reference buffer (Buffer instance)
blikblum Aug 19, 2018
20e3f19
Add missing var in svg test
blikblum Aug 19, 2018
ba902b0
Add dependencies and script to build
blikblum Aug 19, 2018
513f609
#861 Fixing a memory leak when adding too many pngs too quickly.
rsshilli Aug 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
[
"env",
{
"targets": {
"node": "6.10"
}
}
]
],
"plugins": [
"babel-plugin-add-module-exports"
]
}
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "eslint:recommended"
}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
lib/font/tables/.DS_Store
.DS_Store
/node_modules/
/tests/
node-zlib/
src/
playground/
build/
js/
demo/bundle.js
*.html
!demo/browser.html
!demo/browser.html
.idea/
package-lock.json
16 changes: 9 additions & 7 deletions docs/images.coffee.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ Here is an example showing some of these options.

# Scale proprotionally to the specified width
doc.image('images/test.jpeg', 0, 15, width: 300)
.text('Proportional to width', 0, 0)
doc.text('Proportional to width', 0, 0)

# Fit the image within the dimensions
doc.image('images/test.jpeg', 320, 15, fit: [100, 100])
.rect(320, 15, 100, 100)
doc.rect(320, 15, 100, 100)
.stroke()
.text('Fit', 320, 0)

# Stretch the image
doc.image('images/test.jpeg', 320, 145, width: 200, height: 100)
.text('Stretch', 320, 130)
doc.text('Stretch', 320, 130)

# Scale the image
doc.image('images/test.jpeg', 320, 280, scale: 0.25)
.text('Scale', 320, 265)
doc.text('Scale', 320, 265)

# Fit the image in the dimensions, and center it both horizontally and vertically
doc.image('images/test.jpeg', 430, 15, fit: [100, 100], align: 'center', valign: 'center')
.rect(430, 15, 100, 100)
doc.rect(430, 15, 100, 100)
.stroke()
.text('Centered', 430, 0)

Expand All @@ -51,5 +51,7 @@ This example produces the following output:

![0](images/images.png "150")

That is all there is to adding images to your PDF documents with PDFKit. Now
let's look at adding annotations.
**NOTE:** As of version 0.9.0, doc.image() returns a promise, since pngs need to decompressed. While this takes a small amount of resources for a single image, in large numbers the decompression can use a large amount of both CPU and memory and it makes sense to wait for a batch to complete before adding another image.

That is all there is to adding images to your PDF documents with PDFKit. Next let's look at adding annotations.

13 changes: 13 additions & 0 deletions lib/abstract_reference.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
PDFAbstractReference - abstract class for PDF reference
*/

class PDFAbstractReference {
toString() {
throw new Error('Must be implemented by subclasses');
}
}

export default PDFAbstractReference;
140 changes: 0 additions & 140 deletions lib/data.coffee

This file was deleted.

Loading