dealfonso / sapp

Simple and Agnostic PDF Document Parser in PHP - sign PDF docs using PHP
GNU Lesser General Public License v3.0
118 stars 31 forks source link

PDF compare TestCase helper #40

Closed erikn69 closed 1 year ago

erikn69 commented 1 year ago

It could be usefull for using this package with PhpUnit test for check / compare two pdf contents

Ideas?

dealfonso commented 1 year ago

Hi, I don't think that document comparison should be incorporated into SAPP as a "trait", or as a "class". Instead, I think it would be enough to incorporate it as a "use case" or an "example" (e.g., enhancing the pdfcompare.php file).

parallels999 commented 1 year ago

Creo que no afectaría en nada al funcionamiento de SAPP, le agregaría una funcionalidad que no ofrece PHPUNIT y no he visto en otros paquetes y la verdad no se me había ocurrido hasta que lo vi en Fawno/PDF

dealfonso commented 1 year ago

hi,

I have been thinking about this, and I think the method for comparing the documents is not reliable enough. Some minimal changes can cause two equivalent documents not to appear the same, even though they were generated using the same original document and the same sequence of operations. For example, when including the same image in a document, if the SAPP generates those IDs, the image ID may be different.

So I think it is not advisable to include this method as part of SAPP because it can lead to wrong conclusions. It may be sufficient in the context of Fawno/FPDF, but not as a general case.

In any case, thanks for your contribution.