IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
RemovePDFPageGroups
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ralf Ulrich
RemovePDFPageGroups
Commits
34c165e8
Commit
34c165e8
authored
4 years ago
by
Ralf Ulrich
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
83ed275e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+24
-7
24 additions, 7 deletions
README.md
with
24 additions
and
7 deletions
README.md
+
24
−
7
View file @
34c165e8
# Introduction, Context
If PDF files are edited with inkscape, or generated with matplotlib, it is a
typical scenario that PageGroups are part of those files. If multiple such
PDFs are included, e.g. in latex. Only one of those PageGroups is used (there
can only be one at least per page). It is not
clear
if this is a misbehaviour
can only be one at least per page). It is not
very clear to me
if this is a misbehaviour
of inkscape, latex or just a general problem in working with both of them.
L
atex will produce warnings/errors in such cases pointing to the PageGroups.
However, l
atex will produce warnings/errors in such cases pointing to the PageGroups.
With this script here, PDF files can be edited automatically to remove
PageGroups. The internal structure of the PDFs is kept consistent, if needed
the xref tables are updated and fixed.
the xref tables are updated and fixed. The quality of the PDF is not affected.
Also the size of the files is not affected (they become a few bytes shorter).
Use this tool with great care, do not trust its output blindly. Make sure the
generated files are completely OK for the purpose they are indendet for.
This tool helped me to write and review papers for the CMS Collaboration
where no errors on latex are allowed in the final step.
# Warning
**Use this tool with great care, do not trust its output blindly**
.
Make sure image-by-image that the
generated files are completely OK for the purpose they are indended for!
I tested this on files editor with inkscape and generated by matplotlib with
excellent results. Thus a workflow for files, where the normal application of
the script does not result in good results, it is worth trying to first import
in inkscape, re-export as pdf, the apply this script, check output.
This tool helped me to write and review papers for the CMS Collaboration
where no errors on latex are allowed in the final step.
Note, this only works on single-page PDFs! It is only intended for individual
plots/images.
# Usage
`./strip_pdf.py <file.pdf>`
The script will check if file.pdf has any PageGroups and only if one is found
it will create a security copy
`file.save.pdf`
and modify the original file
to remove the PageGroup.
Ralf Ulrich
May 2020
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment