galkahana / hummusrenderrer

NodeJS module for rendering PDF, using a document object/declarative method, using HummusJS
Apache License 2.0
16 stars 5 forks source link

Modify an existing pdf document by adding an image overlay #2

Closed raedle closed 9 years ago

raedle commented 9 years ago

Hi, great work!

I am trying to add a custom generated QR code (image) to the first page of an existing pdf document. It only works with shapes but as soon as I switch to an image it won't display the image.

Do you have any suggestions?

Example:

{
    "source":{
        "external":"pdfFile"
    },
    "externals": {
        "anshika":"https://raw.githubusercontent.com/galkahana/hummusrenderrer/master/samples/img1.jpg",
        "pdfFile": "http://www.ca7.uscourts.gov/rules/type.pdf"
    },
    "pages": [
        {
            "modifiedFrom": 0,
            "width": 595,
            "height": 842,
            "boxes": [
                {
                    "bottom": 300,
                    "left": 100,
                    "image": {
                        "external":"anshika",
                        "transformation": [0.1, 0, 0, 0.1, 0, 0]
                    }
                }
            ]
        }
    ]
}
galkahana commented 9 years ago

Just to verify that i'm getting the same result - running this document description crashes/no return. it's not that you see the PDF without the image or something.

In that case, my suggestion that i find & fix the bug :). will look into it soon.

raedle commented 9 years ago

The document description does not crash. It shows the pdf but without the image.

galkahana commented 9 years ago

right. got that one.

found an issue with one of the dependent-on modules (hummus). corrected, updated. should be fine now.

raedle commented 9 years ago

Great! It works now. Thank you very much.