Skip to content

4 add examples in facades section#6

Merged
andruhovski merged 74 commits intomainfrom
4-add-examples-in-facades-section
Apr 15, 2026
Merged

4 add examples in facades section#6
andruhovski merged 74 commits intomainfrom
4-add-examples-in-facades-section

Conversation

@AnHolub
Copy link
Copy Markdown
Contributor

@AnHolub AnHolub commented Mar 3, 2026

No description provided.

andruhovski and others added 13 commits February 8, 2026 20:45
- Created a new FDF file with form data for "First Name", "Last Name", "City", and "Country".
- Added a JSON representation of the form data with corresponding field names and values.
- Introduced an XFDF file containing the same form data structured in XML format.
- Generated an XML file with the form fields and their respective values.
…leting, extracting, inserting, making booklets, making n-up, adding page breaks, and splitting PDF pages.
@AnHolub AnHolub linked an issue Mar 3, 2026 that may be closed by this pull request
andruhovski and others added 16 commits March 4, 2026 03:54
- Implemented functions for creating booklets, adding margins, resizing contents, and managing pages in PDF documents.
- Added error handling for booklet and N-Up creation.
- Introduced new examples for merging and managing PDF files.
- Removed deprecated page operations file.
andruhovski and others added 15 commits April 2, 2026 02:10
- Generated a comprehensive index of example scripts across multiple categories, including accessibility, document manipulation, form handling, and more.
- Included details such as module paths, available operations, and configuration helpers.
- Documented parse errors for specific example scripts to aid in debugging.
- Deleted outdated examples for adding page stamps, text stamps, and image stamps.
- Introduced a new example for adding a generic stamp to a PDF.
- Added examples for decoding PDF pages and printing large PDF files with various settings.
- Removed legacy code for managing headers and footers in PDF documents.
- Updated the PDF viewer examples to include printing functionalities and handling multiple documents in a single job.
- Added sample PDF file for testing purposes.
- Removed outdated examples for adding image and PDF page stamps.
- Introduced a new comprehensive example for adding various types of stamps (image, text, PDF page) in a single script.
- Enhanced the PDF viewer examples to include decoding pages and printing with various settings.
- Updated the print examples to utilize a viewer class for better management of print settings.
- Added new output files for testing and demonstration purposes.
…ities, enhance header examples, and remove outdated stamp example
…ositioning, and update background image settings
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the repository’s facades section by adding multiple new example scripts (PdfViewer, PdfFileSignature, PdfContentEditor, PdfFileEditor, Form/FormEditor, PdfFileSecurity, PdfFileInfo, Stamp/PdfFileStamp) along with the required sample_data/facades/ inputs, and introduces .codex skill/config documentation for repository automation guidance.

Changes:

  • Added many new facades example scripts under examples/facades/** plus supporting helper module(s).
  • Added new sample input assets under sample_data/facades/** (PDFs, images, form data, attachments).
  • Added .codex/** configuration + skills docs; minor cleanup in README.md, .gitignore, and a whitespace-only tweak in an existing example.

Reviewed changes

Copilot reviewed 64 out of 166 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
sample_data/facades/stamp/input/logo.png Adds image asset used by stamp examples
sample_data/facades/pdf_content_editor/input/SampleAttachment.txt Adds attachment payload for attachment examples
sample_data/facades/form/input/sample_form_xfa.xml Adds XFA XML data for form import examples
sample_data/facades/form/input/sample_form_image.jpg Adds image asset for form/button image appearance examples
sample_data/facades/form/input/sample_form.xml Adds XML form data for import/export samples
sample_data/facades/form/input/sample_form.xfdf Adds XFDF form data for import/export samples
sample_data/facades/form/input/sample_form.json Adds JSON form data for import/export samples
sample_data/facades/form/input/sample_form.fdf Adds FDF form data for import/export samples
sample_data/facades/form/input/get_rich_text_values_in_data.xml Adds rich-text XML data sample
examples/working_with_documents/example_formatting_pdf_document.py Minor formatting-only change in examples list
examples/facades/stamp/add-stamp.py New stamp example suite using PdfFileStamp/Stamp facades
examples/facades/pdf_viewer/print-pdf-document.py New PdfViewer printing examples
examples/facades/pdf_viewer/print-large-pdf-file.py New PdfViewer “large file” printing examples
examples/facades/pdf_viewer/decode-pdf-pages.py New PdfViewer page decoding examples
examples/facades/pdf_file_stamp/add-stamps-to-pdf.py New PdfFileStamp stamp example
examples/facades/pdf_file_stamp/add-pdf-headers.py New PdfFileStamp header examples
examples/facades/pdf_file_stamp/add-pdf-footers.py New PdfFileStamp footer examples
examples/facades/pdf_file_stamp/add-page-numbers-to-pdf.py New PdfFileStamp page numbering examples
examples/facades/pdf_file_signature/usage-rights-management.py New PdfFileSignature usage-rights example
examples/facades/pdf_file_signature/signature-verification.py New signature verification examples
examples/facades/pdf_file_signature/signature-management.py New signature removal examples
examples/facades/pdf_file_signature/signature-integrity-checks.py New signature integrity check examples
examples/facades/pdf_file_signature/signature-information.py New signature info extraction examples
examples/facades/pdf_file_signature/signature-extraction.py New signature image/cert extraction examples
examples/facades/pdf_file_signature/revision-permissions.py New revision/permissions examples
examples/facades/pdf_file_signature/pdf-signing.py New signing examples (uses shared helpers + bundled cert)
examples/facades/pdf_file_signature/pdf-certification.py New certification examples (currently has runtime issues)
examples/facades/pdf_file_signature/certificate.pfx Adds certificate file used by signing/certification examples
examples/facades/pdf_file_signature/_pdf_file_signature_helpers.py Shared helper utilities for signature examples
examples/facades/pdf_file_security/set-privileges.py New PdfFileSecurity privilege examples
examples/facades/pdf_file_security/encrypt-pdf.py New PdfFileSecurity encryption examples
examples/facades/pdf_file_security/decrypt-pdf.py New PdfFileSecurity decryption examples
examples/facades/pdf_file_security/change-password.py New PdfFileSecurity password change examples
examples/facades/pdf_file_info/pdf-metadata.py New PdfFileInfo metadata examples
examples/facades/pdf_file_info/page-information.py New PdfFileInfo page info/offset examples
examples/facades/pdf_file_info/document-properties.py New PdfFileInfo document properties examples
examples/facades/pdf_file_editor/splitting-pdf-documents.py New PdfFileEditor splitting examples
examples/facades/pdf_file_editor/page-merging.py New PdfFileEditor concatenation examples
examples/facades/pdf_file_editor/page-managment.py New PdfFileEditor page management examples (filename typo)
examples/facades/pdf_file_editor/page-layout-and-margins.py New PdfFileEditor layout/margins/page-break examples
examples/facades/pdf_file_editor/merge-pdf-documents.py Placeholder file (no runnable example code)
examples/facades/pdf_file_editor/booklet-and-nup-layout.py New PdfFileEditor booklet + N-up examples
examples/facades/pdf_content_editor/viewer-preferences.py New PdfContentEditor viewer-preference examples
examples/facades/pdf_content_editor/text-editing.py New PdfContentEditor text replacement examples
examples/facades/pdf_content_editor/stamps.py New PdfContentEditor stamp management examples
examples/facades/pdf_content_editor/multimedia.py New PdfContentEditor movie/sound annotation examples
examples/facades/pdf_content_editor/link-and-navigation.py New PdfContentEditor link creation/extraction examples
examples/facades/pdf_content_editor/images.py New PdfContentEditor image replacement/deletion examples
examples/facades/pdf_content_editor/drawing-annotations.py New PdfContentEditor drawing annotation examples
examples/facades/pdf_content_editor/document-actions.py New PdfContentEditor document action examples
examples/facades/pdf_content_editor/binding-and-streams.py New PdfContentEditor bind/save stream overload examples
examples/facades/pdf_content_editor/attachments.py New PdfContentEditor attachments examples
examples/facades/pdf_content_editor/annotations.py New PdfContentEditor annotation examples
examples/facades/formeditor/modifying-form-fields.py New FormEditor form-field modification examples
examples/facades/formeditor/customizing-field-appearance.py New FormEditor appearance customization examples (some no-ops)
examples/facades/formeditor/creating-form-field.py New FormEditor field creation examples
examples/facades/formeditor/adding_scripts_and_submit_actions.py New FormEditor script/submit-action examples
examples/facades/form/working_with_button_fields.py New Form facade button-field examples
examples/facades/form/reading-and-inspecting-form-data.py New Form facade inspection examples
examples/facades/form/managing-pdf-form-fields.py New Form facade flatten/rename examples
examples/facades/form/importing_pdf_form_data.py New Form facade import examples (XML/FDF/XFDF/JSON/XFA)
examples/facades/form/filling_form_fields.py New Form facade “fill fields” examples
examples/facades/form/exporting_pdf_form_data.py New Form facade export examples
README.md Minor formatting + method name correction in docs
.gitignore Ignores .vscode workspace files
.codex/skills/pdf-operations/SKILL.md Adds local “skill” documentation for pdf operations patterns
.codex/skills/code-style/SKILL.md Adds local “skill” documentation for code style conventions
.codex/config.yaml Adds Codex configuration for the repo
.codex/SKILLS.md Adds skills index documentation

Comment thread examples/facades/pdf_viewer/decode-pdf-pages.py Outdated
Comment on lines +13 to +19
from _pdf_file_signature_helpers import (
DEFAULT_INPUT_PDF,
create_pdf_file_signature,
create_doc_mdp_signature,
create_pdf_file_signature,
create_signature_rectangle,
)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import list from _pdf_file_signature_helpers includes create_pdf_file_signature twice, which is redundant and can confuse readers about what’s intended. Remove the duplicate import to keep the module clean.

Copilot uses AI. Check for mistakes.
Comment thread examples/facades/pdf_content_editor/stamps.py Outdated
Comment thread examples/facades/pdf_file_editor/merge-pdf-documents.py Outdated
Comment on lines +24 to +33
viewer = pdf_facades.PdfViewer()
viewer.auto_resize = True
viewer.auto_rotate = True
viewer.auto_rotate_mode = pdf_facades.AutoRotateMode.NONE
viewer.print_page_dialog = False
viewer.print_as_image = False
viewer.print_as_grayscale = False
viewer.use_intermidiate_image = True
viewer.printer_job_name = "Aspose.PDF Large File Print"
viewer.coordinate_type = ap.PageCoordinateType.CROP_BOX
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto_rotate_mode is set using pdf_facades.AutoRotateMode.NONE here, while print-pdf-document.py uses ap.Printing.AutoRotateMode.NONE. If AutoRotateMode isn’t exposed on aspose.pdf.facades, this will raise an AttributeError at runtime. Consider using the same enum namespace consistently across viewer examples (whichever is correct for the Python binding).

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +72
examples = [
("Set Certificate for Signing", set_certificate_for_signing),
("Certify PDF with MDP Signature", certify_pdf_with_mdp_signature),
("Apply Document-Level Certification", apply_document_level_certification),
]
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pdf-certification.py references set_certificate_for_signing in the examples list, but that function is not defined or imported in this module, so run_all_examples() will raise a NameError. Either import it (e.g., from pdf-signing.py) or remove that entry / define a local implementation.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment on lines +145 to +158
for name, func in examples:
try:
output_file = path.join(output_dir, f"{func.__name__}.pdf")
if func.__name__ in (
"add_image_stamp",
"add_stamp_to_specific_pages",
"add_background_image_stamp",
):
func(input_pdf, image_file, output_file)
elif func.__name__ == "add_pdf_page_as_stamp":
func(input_pdf, input_pdf, output_file)
else:
func(input_pdf, output_file)
print(f"✅ Success: {name}")
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output naming here deviates from the repo’s common {function_name}_out.pdf pattern used throughout other examples, which makes outputs harder to scan and consistent tooling harder. Consider changing the output filename to include the _out suffix (e.g., f"{func.__name__}_out.pdf").

Copilot generated this review using guidance from repository custom instructions.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

("Embed fonts in existing PDF", embedded_fonts),
("Embed fonts in new PDF", embedded_fonts_in_new_document),
("Set default font", set_default_font),
("Set default font", set_default_font),
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace was introduced at the end of this line. Please remove it to avoid noisy diffs and keep formatting consistent.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment thread examples/facades/formeditor/customizing-field-appearance.py Outdated
Comment thread examples/facades/pdf_viewer/decode-pdf-pages.py
andruhovski and others added 2 commits April 15, 2026 10:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andruhovski
Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andruhovski andruhovski merged commit e5323d3 into main Apr 15, 2026
@andruhovski andruhovski deleted the 4-add-examples-in-facades-section branch April 15, 2026 08:00
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.

Add examples in Facades section

4 participants