Browse Source

Changed: renamed .nextPage() to .addPage()

v1.x
TJ Holowaychuk 13 years ago
parent
commit
eb0edf2ce4
  1. 4
      examples/multi-page-pdf.js
  2. 4
      examples/pdf-images.js
  3. 4
      src/CanvasRenderingContext2d.cc
  4. 2
      src/CanvasRenderingContext2d.h

4
examples/multi-page-pdf.js

@ -24,12 +24,12 @@ function p(str) {
reset();
h1('PDF demo');
p('Multi-page PDF demonstration');
ctx.nextPage();
ctx.addPage();
reset();
h1('Page #2');
p('This is the second page');
ctx.nextPage();
ctx.addPage();
reset();
h1('Page #3');

4
examples/pdf-images.js

@ -34,14 +34,14 @@ h1('PDF image demo');
p('This is an image embedded in a PDF');
img('examples/images/squid.png');
p('Figure 1.0 - Some squid thing');
ctx.nextPage();
ctx.addPage();
reset();
h1('Lime cat');
p('This is a pretty sweet cat');
img('examples/images/lime-cat.jpg');
p('Figure 1.1 - Lime cat is awesome');
ctx.nextPage();
ctx.addPage();
fs.writeFile('out.pdf', canvas.toBuffer());
console.log('created out.pdf');

4
src/CanvasRenderingContext2d.cc

@ -62,7 +62,7 @@ Context2d::Initialize(Handle<Object> target) {
Local<ObjectTemplate> proto = constructor->PrototypeTemplate();
NODE_SET_PROTOTYPE_METHOD(constructor, "drawImage", DrawImage);
NODE_SET_PROTOTYPE_METHOD(constructor, "putImageData", PutImageData);
NODE_SET_PROTOTYPE_METHOD(constructor, "nextPage", NextPage);
NODE_SET_PROTOTYPE_METHOD(constructor, "addPage", AddPage);
NODE_SET_PROTOTYPE_METHOD(constructor, "save", Save);
NODE_SET_PROTOTYPE_METHOD(constructor, "restore", Restore);
NODE_SET_PROTOTYPE_METHOD(constructor, "rotate", Rotate);
@ -417,7 +417,7 @@ Context2d::New(const Arguments &args) {
*/
Handle<Value>
Context2d::NextPage(const Arguments &args) {
Context2d::AddPage(const Arguments &args) {
HandleScope scope;
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
if (!context->canvas()->isPDF()) {

2
src/CanvasRenderingContext2d.h

@ -57,7 +57,7 @@ class Context2d: public node::ObjectWrap {
static Handle<Value> IsPointInPath(const Arguments &args);
static Handle<Value> BeginPath(const Arguments &args);
static Handle<Value> ClosePath(const Arguments &args);
static Handle<Value> NextPage(const Arguments &args);
static Handle<Value> AddPage(const Arguments &args);
static Handle<Value> Clip(const Arguments &args);
static Handle<Value> Fill(const Arguments &args);
static Handle<Value> Stroke(const Arguments &args);

Loading…
Cancel
Save