Skip to content

Image scale to fit#35

Open
shinjukunian wants to merge 10 commits intomasterfrom
Image_ScaleToFit
Open

Image scale to fit#35
shinjukunian wants to merge 10 commits intomasterfrom
Image_ScaleToFit

Conversation

@shinjukunian
Copy link
Copy Markdown
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