typemytype / drawbot

http://www.drawbot.com
Other
402 stars 63 forks source link

Placing a PDF with image() does not respect the mediaBox of the PDF. #461

Open JakobFangmeier opened 2 years ago

JakobFangmeier commented 2 years ago

Placing a PDF in Drawbot does not respect the mediaBox.

Expected result, as replicated in Illustrator:

Screenshot 2021-12-11 at 10 50 47

Actual result in Drawbot:

Screenshot 2021-12-11 at 10 52 56
typemytype commented 2 years ago

RF currently doesnt take the mediaBox into account to position the pdf asset.

APDFPage has support to retrieve bounds for each display box: https://developer.apple.com/documentation/pdfkit/pdfpage/1504213-boundsforbox?language=objc

and the position has to be adjusted here: https://github.com/typemytype/drawbot/blob/master/drawBot/context/pdfContext.py#L281-L285

this goes maybe together with this unsolved PR https://github.com/typemytype/drawbot/pull/304

typemytype commented 2 years ago

displayTrimBox.zip

image