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

Enhance to_zpl Method to Support Individual ZPL Commands for Each Page #5

Merged
merged 3 commits into from
May 12, 2024

Conversation

Federaffo
Copy link
Contributor

Description:

This PR introduces the ability to wrap each PDF page with its own set of ZPL start (^XA) and end (^XZ) commands when converting PDF pages to ZPL format. This feature is controlled by the split_page attribute, allowing each page to be treated as a separate print job if required. This update provides greater flexibility in handling multi-page PDFs, especially useful for scenarios where independent printing of each page is needed.

Changes:

  • Method Update: The to_zpl method within the conversion class has been modified to check the split_page attribute. This determines whether each page's ZPL code should be individually wrapped with ^XA and ^XZ.
  • Conditional Logic: Added conditional logic to either wrap each page individually or collectively, based on the self._complete_zpl and self.split_page attributes.
  • Flexible Printing Option: Users can now choose to print each page as a separate job or as part of a single continuous job, enhancing the method's utility in diverse printing scenarios.

Impact:

  • Usability Improvement: Makes the ZPL conversion process more versatile and applicable to a broader range of printing scenarios.
  • Backward Compatibility: Default behavior remains unchanged unless the split_page attribute is explicitly set to True, ensuring that existing implementations are not affected.
  • Enhanced Control: Users gain more control over how the output is handled by ZPL-compatible printers, particularly beneficial for batch printing tasks.

Federaffo and others added 3 commits May 8, 2024 10:35
Add documentation and tests for split_pages attribute.
Refactored logic.
@miikanissi
Copy link
Owner

Thank you for the contribution!

@miikanissi miikanissi merged commit 5ad91e9 into miikanissi:master May 12, 2024
7 checks passed
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.

None yet

2 participants