Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge page improved and bug fixes. #34

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

Averell7
Copy link

  1. 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.

  2. 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.

  3. mergeResources presently ignores Xobjects which leads to serious problems when merging pages.

  4. 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).

@Averell7
Copy link
Author

Since I am not really comfortable with object oriented programming, my code may be enhanced. But as is, it works for more than one year now, without known problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants