-
-
Notifications
You must be signed in to change notification settings - Fork 47
Improve watermark image #255
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
Draft
PrzemyslawKlys
wants to merge
23
commits into
master
Choose a base branch
from
ImproveWatermarkImage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…mage1` method * Un-commented logging statements to display watermark and image counts. * Improved visibility of watermark properties during document creation and loading.
… watermark examples * Introduced a new method to demonstrate various watermark functionalities. * Supports adding text and image watermarks across multiple sections. * Includes logging for initial and final watermark counts for better tracking.
* Added a null return statement to ensure consistent behavior. * Enhanced `IsImage` property to check for both DrawingML and VML images in paragraphs.
…on retrieval * Introduced `Type`, `IsHeader`, and `IsFooter` properties to determine the type of the instance. * Added `Section` property to retrieve the associated `WordSection` for the Header or Footer.
- Enhanced `Watermarks` property to include watermarks from Default, First, and Even headers. - Added aggregation of watermarks from Default, First, and Even footers. - Note: Potential duplicates may occur if the same watermark exists in multiple header types.
…ooters * Implemented logic to aggregate both text and image watermarks. * Added checks to prevent duplicate image watermarks. * Improved handling of `SdtBlock` elements for text watermarks.
…l handling * Changed `_sdtBlock` visibility to internal for better access control. * Enhanced null handling in the `_shape` property and watermark retrieval logic. * Updated constructor to initialize `_document` with `Picture` parameter.
* Clarified that the `Images` property aggregates only DrawingML images. * VML images, such as watermarks, are accessed via `WordParagraph.Picture`.
* Introduced a new method `FindImagePart` to streamline the process of locating the image part associated with the `WordImage`. * Enhanced handling for image parts in headers and footers, improving robustness against missing IDs.
* Improved null handling for watermark counts in headers. * Added detailed output for watermark counts across sections. * Enabled different first page headers for sections with appropriate watermarks.
…ion tests * Added assertions to verify the number of images in the document after adding images in tests. * Ensures that the image count is correctly tracked during document creation.
…ation test * Changed assertion from `Assert.Equal(1, document.Images.Count)` to `Assert.Single(document.Images)` for clarity and consistency.
…andling * Updated `GetGraphic` method to include `description` parameter. * Enhanced `FindImagePart` method to handle `ArgumentOutOfRangeException` more gracefully. * Added comments for clarity on the image part search process in headers and footers.
* Updated the `IsImage` property to check for the presence of `Image` directly. * Removed legacy checks for `Drawing` and VML `Picture` elements for clarity and maintainability.
* Cleaned up unnecessary `using` statements to improve code readability and maintainability.
* Updated the color of the default text watermark in Section 0 to improve visibility.
* Implemented `Test_AddRemoveMultipleWatermarks` to verify the functionality of adding and removing both text and image watermarks across different sections. * Ensured assertions check the correct count and properties of watermarks after each operation. * Validated the persistence of watermark states after saving and reloading the document.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.