Skip to content

Instantly share code, notes, and snippets.

@dl6nm
Created May 8, 2019 16:29
Show Gist options
  • Save dl6nm/c09e27a36ee76c21edb8c69f473e6ac8 to your computer and use it in GitHub Desktop.
Save dl6nm/c09e27a36ee76c21edb8c69f473e6ac8 to your computer and use it in GitHub Desktop.
Clone JavaScript object with JSON stringify and parse in the callas pdfToolbox
function clone(obj) {
/*
Use this function in a callas pdfToolbox process plan for cloning objects (e.g. app.doc)
to manipulate them after a check was executed.
*/
if (obj !== undefined) {
return JSON.parse(JSON.stringify(obj));
}
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment