Scale or resize only visible layers in PDF #4401
Replies: 2 comments
-
This is impossible to achieve ... at least in this way. PDF, as a file format, has little or no internal integrity checks. Therefore, if the page references an xref in the expectation that this is a layer with a ON/OFF state, but that xref does not exist or is not referenced in the document's central OC information, the layer is assumed (by PDF and all the viewer software) to be ON. That is your situation. |
Beta Was this translation helpful? Give feedback.
-
Hard to say what a solution might be. In any case, it would have to be quite hacky. As an additional complication, the object inserted into the target page via |
Beta Was this translation helpful? Give feedback.
-
I have scaled a PDF and saved it as new pdf, when I reviewed the rescaled new pdf, I noticed that the layers which are hidden in the original pdf are becoming visible in new pdf.
when I checked the OCG layer of both input and output pdf, I got this :
I understand why we get "None" for output pdf, but the issue is when I see the output pdf, I can notice some text, tables and images which are not there/visible in input pdf, which means on scaling using above code, the OCG layers which are turned off are also scaled and becomes visible, and as we get "None" for the doc.get_layer() of output.pdf, we can turn those them off.
How can we scale the PDF only with visible layers.
Beta Was this translation helpful? Give feedback.
All reactions