julianhille / MuhammaraJS

Muhammara a node module with c/cpp bindings to modify PDF with js for node or electron (based/replacement on/of galkhana/hummusjs)
Other
205 stars 41 forks source link

Fix: support negative rotation in Recipe page changes #359

Closed thmclellan closed 7 months ago

thmclellan commented 7 months ago

Minor change to handle PDF pages with negative rotation (-90, -180, -270) when modifying an existing PDF. This is unusual but it happens occasionally. In a recent customer PDF, the file shows a setting of /Rotate -180/ and MuhammaraJS reports the same.

Looking at the Adobe PDF spec v1.7, it just says "The number of degrees by which the page should be rotated clockwise when displayed or printed. The value must be a multiple of 90. Default value: 0."... so I guess some PDF writers have taken that to mean negative is okay. Thanks

thmclellan commented 7 months ago

Great, I merged in develop before adding a line, hopefully that works. Thanks for this library!