Correct PDF palette size when saving#7555
Conversation
homm
left a comment
There was a problem hiding this comment.
There is a third member in dict_obj["ColorSpace"] list which is 255. Isn't better to adjust it?
|
Looking at page 164 of https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf, '255' is the 'hival', the 'maximum valid index value'. It is not simply the number of palette entries, so we couldn't correctly adjust it to lower the number of required palette entries without also needing to remap the palette. |
|
The maximum valid index value in the pallet (the current pallet, as I understand it). This is articulated because it's not a number or items, it's the index of the last element. "The colour table data shall be m•Y(hival +1) bytes long". So if we say that hival is 31, we can write (31+1)•3 = 96 bytes. |
ce47aca to
98b7300
Compare
|
Ah, I was confused. Ok, I've adjusted that value instead. Thanks. |
Resolves #7554
#7289 set the C palette to be empty by default. The issue has found that this causes P PDFs to appear blank. Testing, I find that the problem is that there can now be fewer than 256 palette entries saved to the PDF file, and that padding the palette to 256 entries fixes it.