Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
get_data (line 1555) has a bug. With the present code, the end of line is not written in some cases where it should, and this conducts to the merging of two lines and invalid code.
With the correction suggested, there are some useless end of lines added, but this is not a problem in a pdf file.
createBlankPage : although /Contents is not required there are programs which will return an error when they encounter a page without this resource. Adding an empty /Contents does no harm and prevents these problems.
mergeResources presently ignores Xobjects which leads to serious problems when merging pages.
mergePage3 and the related functions (setContent, extractContent and _addCode) allows a much faster merging by reducing to the minimum the calls to parseContentStream. To see it in action, try pdf-Booklet 2.0 present on SourceForge. The speed improvment may be between 4x and 200x, depending of the situation. The average speed improvment is 50x (50 times faster).