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

Image scale to fit #35

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Image scale to fit #35

wants to merge 10 commits into from

Conversation

shinjukunian
Copy link
Owner

@shinjukunian shinjukunian commented Jan 16, 2023

This PR implements image autosizing if a custom page size is defined and the image is larger than the printable area of the page. In this case, the image is shrunk to fit the printable area.
Issues with the current implementation:

  • custom sizing of the NSTextAttachement (NSTextAttachement.bounds) is overridden if it is larger than th printable area. This might be surprising.
  • The size of the test image (lenna.png, 512x512 pixel) in Word is only half the expected size when inserted via copy / paste into Word or if automatic sizing (no page size or bounds defined in DocX) are used. It is not entirely clear when default values Word is using for autosizing.

@shinjukunian shinjukunian linked an issue Feb 25, 2023 that may be closed by this pull request
Morten Bertz added 2 commits February 25, 2023 15:32
# Conflicts:
#	DocX/DocXWriting.swift
#	DocXTests/DocXTests.swift
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.

Suggestion: set image extent so that it fits on a page
1 participant