Skip to content

function updateInfo only accepts a file path or JSON #28

@meinte

Description

@meinte

Describe the bug
The function 'updateInfo' will assume that if the parameter 'data' is a string, that it is in fact a path to a file which contains the info to be updated. If it is not a string it will assume it's an object which can be serialised to something pdftk can work with through 'generateInfoFromJSON'.

The issue is two fold; Firstly, I would like to have a way to provide a string that is simply passed on, instead of treated as if it is a path. I could serialise it into a JSON, but herein lies the second issue; the function 'generateInfoFromJSON' does not fully support everything that can be thrown at pdftk (notably; bookmarks)

To Reproduce
Pass a string to 'updateInfo'; it tries to load it as a file.

Expected behavior
I would like to be able to pass a string and simply be passed to pdftk, either because of the addition of a flag ('isFile'?) or some other mechanism. Alternatively, 'generateInfoFromJSON' could be changed to support all the info that can be supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions