Hi,
We are trying to achieve the same as in this post:
https://www.princexml.com/forum/topic/3228/how-getting-a-page-count-multiple-of-4
and as far as I can find, we do have to run Prince twice to achieve this.
However, we are running Prince from our project built in Node.js, using the Node wrapper (https://www.npmjs.com/package/prince) for Prince. I cannot find a simple way to call the two stage process from the Node wrapper.
As far as I can tell, in the first pass you use an append command in the CLI, ">>" to append the console log back into the source HTML. In the Node wrapper, we cannot pass an append call as an option, the wrapper only takes Prince CLI options.
I have managed to get it to work, but only with a lot of hacking of the Node wrapper, to get it to pass through the append command without turning it into an option, and to run Prince using a shell command rather than directly through child_process.
So we potentially have a solution going forward, albeit an ugly one, which we can tidy up for production. But before we do that, can I ask:
If the only way to run the two-pass solution is through a command using ">>", or if there is a Prince option that I have missed?
If we do have to use ">>", will it work on all OSs (I don't know too much about shell scripting)? We are currently building for Windows, but might want this to run on Linux servers in future.
If there is potentially a better way of doing this in Node than overriding the Node wrapper to make the changes above?
Thanks
We are trying to achieve the same as in this post:
https://www.princexml.com/forum/topic/3228/how-getting-a-page-count-multiple-of-4
and as far as I can find, we do have to run Prince twice to achieve this.
However, we are running Prince from our project built in Node.js, using the Node wrapper (https://www.npmjs.com/package/prince) for Prince. I cannot find a simple way to call the two stage process from the Node wrapper.
As far as I can tell, in the first pass you use an append command in the CLI, ">>" to append the console log back into the source HTML. In the Node wrapper, we cannot pass an append call as an option, the wrapper only takes Prince CLI options.
I have managed to get it to work, but only with a lot of hacking of the Node wrapper, to get it to pass through the append command without turning it into an option, and to run Prince using a shell command rather than directly through child_process.
So we potentially have a solution going forward, albeit an ugly one, which we can tidy up for production. But before we do that, can I ask:
If the only way to run the two-pass solution is through a command using ">>", or if there is a Prince option that I have missed?
If we do have to use ">>", will it work on all OSs (I don't know too much about shell scripting)? We are currently building for Windows, but might want this to run on Linux servers in future.
If there is potentially a better way of doing this in Node than overriding the Node wrapper to make the changes above?
Thanks