mikehaertl/php-pdftk

Pdf cannot be fed as constructor argument to new Pdf instance after getData()

rotdrop opened this issue · 3 comments

An Pdf instance is marked as "executed" after calling Pdf::getData() and hence no other operation can be performed. However, the documented feature to feed an "executed" Pdf-intsance into the CTOR does not work, because there is not temporary file holding the (not) processed PDF after just calling getData(). This is a little unexpected behavour.

The idea when feeding a PDF instance into another is that you can chain several modifications. As getData() is no modification this does not make sense here. I wonder a bit why someone would want to do that.

I know that this is not perfect - but the library really started as a quick way to make working with pdftk easier. I only added the chaining part for some convenience in an attempt to improve the "one operation per instance" limitation. It was never meant to be perfect or to stop you from doing things that make no sense.

So I think I won't add any fix for this.

Well, I found it surprising. For the "not perfect": it is really a nice and helpful piece of software, I'm sorry if my comments sound negative, they weren't meant that way. I actually plan to continue to use your library, many thanks for you work!

No worries, I didn't perceive your comments to be negative and am always open for improvements. But in this case I just think it's not worth the extra effort.