-
Notifications
You must be signed in to change notification settings - Fork 20
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
new rule: minimum margins #8
Comments
I was looking at doing some work on this rule. One of our requirements is that it we only warn customers if the object in the margins will actually appear in printing. So not if it's white, or transparent, or invisible somehow. With text and vectors we can check the colour when stroked/filled, but presumably with images, we'd need to render it and check whether the intersecting area contained any non-white/alpha pixels. Do you have any thoughts about this approach? Am I missing something obvious? |
Your approach sounds reasonable. I think it's more or less what I'd try - I've just put it off because it sounds hard 😄 |
I've actually ended up going for a slightly different solution, which feels a bit dirty, but works well. We just render the PDF to a series of CMYK bitmaps, and then check whether any of the pixels in the margin area have any values > 0. On 15 May 2013, at 13:33, James Healy [email protected] wrote:
|
I'm happy to share this code, but at the moment it doesn't integrate into preflight - it's run as supplementary check. If you think something like that might be worth including, I'm happy to do some work to fit it in somehow, or release it as an extension or something. On 15 May 2013, at 13:41, Tom Taylor [email protected] wrote:
|
How do you render the page to a bitmap? If it's pure ruby I'd be happy to find a way to integrate it. If it involves shelling out or a C extension I think I'd prefer to leave it out. |
RMagick I'm afraid. It's not really ideal, but it seemed like the best way to do it considering the complexity of the alternatives. The RMagick bit would be easy to swap out, if there's a Ruby only library that made sense. It's all available at: https://github.com/newspaperclub/pdf_margins On 18 May 2013, at 07:46, James Healy [email protected] wrote:
|
This is the opposite of the minimum bleed rule - there must be X distance between a specified PageBox and content.
The text was updated successfully, but these errors were encountered: