Skip to content

Support for Complex Objects? #3

Description

@Albert-IV

This is actually pretty useful if you want to handle PDF's through node.js servers. Ever thought about supporting complex objects? Right now if you want to support dot notation you need to do something like this:

var dataObj = {};

dataObj['user.name'] = 'Bob';
dataObj['user.signature'] = 'CEO';

var fdfContents = fdf.generate(dataObj);

And if you attempt to do anything fancier than a single level deep object it dies:

var dataObj = {};

dataObj.user.name = 'Bob';
dataObj.user.signature = 'CEO';

var fdfContents = fdf.generate(dataObj);
//  ^ Dies

I bet you could do some fancy recursive functions and create a path variable that displays an object's dot notation path. Set up an identical object of one that was passed into the .generate(), and you could use that object when you input the name into the .fdf file contents.

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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