Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to append page, make sure it's fine #9

Closed
ziram opened this issue Sep 11, 2013 · 15 comments
Closed

unable to append page, make sure it's fine #9

ziram opened this issue Sep 11, 2013 · 15 comments
Assignees

Comments

@ziram
Copy link

ziram commented Sep 11, 2013

Hi,

I'm using this code:

var hummus = require('hummus');

{ var pdfWriter = hummus.createWriter('./output/appendTest1.pdf',
{
version:hummus.ePDFVersion14
});

pdfWriter.appendPDFPagesFromPDF('./sample.pdf');
pdfWriter.appendPDFPagesFromPDF('./sample1.pdf');

pdfWriter.end();

console.log('done - ok');

}

When I tested it in other PDF, it works fine.
But when I tried it to the files I need,
The error was always, "unable to append page, make sure it's fine"

Does it require some version of PDF, or any format?
I just thought any PDF File will do.

Thanks in advance.

@galkahana
Copy link
Owner

should work on all of them. how about sending me the sample pdf?

@ghost ghost assigned galkahana Sep 15, 2013
@ziram
Copy link
Author

ziram commented Sep 16, 2013

I don't really know why it doesn't work with my PDF Files.
I'm using pdfkit module of node.js in creating them.
Does this affect the function of appending pdf?

For additional information, I am using:
node js - v0.8.20
pdfkit - v0.2.0
hummus - v1.0.16

and this is the sample code for generating PDF File:

var PDFDocument = require('pdfkit'),
doc = new PDFDocument(
{
layout: 'landscape'
});

doc.fillColor('#000000')
.text('Hello World')

doc.rect(100, 100, 100, 100)
.fillAndStroke('red','black')

doc.write('sample.pdf');

Attached here is the screenshot of the error I am encountering.
capture

Note: Sample PDF File will be sent thru e-mail, since this doesn't support attaching such format.

Thanks again in advance.
I highly appreciate your response.

@ziram
Copy link
Author

ziram commented Sep 16, 2013

I don't really know why it doesn't work with my PDF Files.
I'm using pdfkit module of node.js in creating them.
Does this affect the function of appending pdf?

For additional information, I am using:
node js - v0.8.20
pdfkit - v0.2.0
hummus - v1.0.16

and this is the sample code for generating PDF File:

var PDFDocument = require('pdfkit'),
doc = new PDFDocument(
{
layout: 'landscape'
});

doc.fillColor('#000000')
.text('Hello World')

doc.rect(100, 100, 100, 100)
.fillAndStroke('red','black')

doc.write('sample.pdf');

Attached here is the screenshot of the error I am encountering and the
sample PDF I am using.
[image: capture]https://f.cloud.github.com/assets/5434307/1146686/ab92327e-1e77-11e3-86eb-88c3ff5cf078.JPG

Thanks again in advance.

I highly appreciate your response.

On Mon, Sep 16, 2013 at 1:37 AM, gal kahana notifications@github.comwrote:

should work on all of them. how about sending me the sample pdf?


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24475981
.

@galkahana
Copy link
Owner

thanks man. just send me the PDF, i'll be able to tell what's the probably. my initial assumption is that any PDF but encrypted one is eligible for the library usage. i might be wrong, and then it'd probably be a bug. got my email?

@ziram
Copy link
Author

ziram commented Sep 17, 2013

This blog do not support attaching PDF Files. I already sent the copy of the sample PDF thru e-mail.
If you didn't receive it, where else can I send the sample PDF?

I really hope you can help me with my issue.

@galkahana
Copy link
Owner

email to gal@pdfhummus.com

@ziram
Copy link
Author

ziram commented Sep 17, 2013

Hi,

Email sent at gal@pdfhummus.com
sample PDF also was attached.

@galkahana
Copy link
Owner

got it, will look into it today/tomorrow.

@ziram
Copy link
Author

ziram commented Sep 17, 2013

okay.. Thank you so much..
Hope you can help me.

On Tue, Sep 17, 2013 at 4:47 PM, gal kahana notifications@github.comwrote:

got it, will look into it today/tomorrow.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24572650
.

@ziram
Copy link
Author

ziram commented Sep 19, 2013

Hi,

Is there any update on my issue?

Thanks!

On Tue, Sep 17, 2013 at 4:49 PM, Mariz Salvador
rizsalvador1493@gmail.comwrote:

okay.. Thank you so much..
Hope you can help me.

On Tue, Sep 17, 2013 at 4:47 PM, gal kahana notifications@github.comwrote:

got it, will look into it today/tomorrow.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24572650
.

@galkahana
Copy link
Owner

Ziram, i inspected the PDF file sample.pdf and found an issue with it. the size entry in its catalog is 7 while the xref actual size is 8. this is what creates the error. it's a problem with how pdfkit creates files.
i'll see if i can teach hummus to be more lenient about this. although incorrect, i should be able to teach hummus to work also with pdfs like this. gimme an hour or two.

@galkahana
Copy link
Owner

Ziram, i updated hummusJS and the related PDFWriter code to support files with this error. i'm keeping it a policy, in case someone complains, but the default would be to allow such files.

you can now update to the new hummus module (npm update hummus), you should get something with version 10.0.17 or higher (working on other things now,and may update further) and it should work fine.
please verify and let me know if it works.

Gal.

@ziram
Copy link
Author

ziram commented Sep 20, 2013

Hi again,

How can I update my hummusJS?
I tried the "npm update hummus" but nothing changed.

I also tried to re-install the hummusJS ("npm install hummus"),
the version became
"version": "1.0.18"
and then I tried appending my PDF Files but still, I got the same error.

If that works fine on you, can you give me instructions on how to make it
work on my workstation?..

I really need this one.
Thank you so much..

On Thu, Sep 19, 2013 at 11:55 PM, gal kahana notifications@github.comwrote:

Ziram, i updated hummusJS and the related PDFWriter code to support files
with this error. i'm keeping it a policy, in case someone complains, but
the default would be to allow such files.

you can now update to the new hummus module (npm update hummus), you
should get something with version 10.0.17 or higher (working on other
things now,and may update further) and it should work fine.
please verify and let me know if it works.

Gal.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24750167
.

@ziram
Copy link
Author

ziram commented Sep 20, 2013

Hi Gal,

Oh no, it's my fault..

That works VERY GREAT!
Thank you so much for helping me..
I owe you a lot..
It was a big big help for me..
You're a genius.. :)

This module would be a great help for me.
Thanks again!

Ziram

On Fri, Sep 20, 2013 at 10:29 AM, Mariz Salvador
rizsalvador1493@gmail.comwrote:

Hi again,

How can I update my hummusJS?
I tried the "npm update hummus" but nothing changed.

I also tried to re-install the hummusJS ("npm install hummus"),
the version became
"version": "1.0.18"
and then I tried appending my PDF Files but still, I got the same error.

If that works fine on you, can you give me instructions on how to make it
work on my workstation?..

I really need this one.
Thank you so much..

On Thu, Sep 19, 2013 at 11:55 PM, gal kahana notifications@github.comwrote:

Ziram, i updated hummusJS and the related PDFWriter code to support files
with this error. i'm keeping it a policy, in case someone complains, but
the default would be to allow such files.

you can now update to the new hummus module (npm update hummus), you
should get something with version 10.0.17 or higher (working on other
things now,and may update further) and it should work fine.
please verify and let me know if it works.

Gal.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24750167
.

@galkahana
Copy link
Owner

Glad to hear that it worked. thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants