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

Support page marks and bleed #471

Closed
deathowl opened this Issue May 23, 2017 · 5 comments

Comments

3 participants
@deathowl

deathowl commented May 23, 2017

@page {
  size: 159mm 237mm;
  margin: 3mm 3mm 3mm 3mm;
  marks: crop;
}

WARNING: Ignored marks: crop at 4:5, unknown property.

@liZe liZe changed the title from marks: crop; property ignored to Support page marks May 23, 2017

@liZe liZe added this to Page Size in CSS Paged Media Module Level 3 May 23, 2017

@liZe liZe added the feature label May 23, 2017

@liZe liZe changed the title from Support page marks to Support page marks and bleed May 23, 2017

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe May 23, 2017

Member

These features should be quite easy to add, using a SVG file for crop marks and another one for crosses, and applying them to the bleed area box.

Member

liZe commented May 23, 2017

These features should be quite easy to add, using a SVG file for crop marks and another one for crosses, and applying them to the bleed area box.

@liZe liZe added this to the v0.41 milestone Sep 5, 2017

@dark-light-cz

This comment has been minimized.

Show comment
Hide comment
@dark-light-cz

dark-light-cz Sep 19, 2017

Contributor

Hello!
I know it's nor in standard nor in any draft but can you extend support of bleedbox to be available in 4 sizes. I expect it's not problem and is only extension and does't bkeak anything functional.
Th reason is that i use weasyprint to generate pages for printer working with SRA4(225x320 mm) paper an i need bleed mark to paper A4(210mmx297mm)
I tried to extend the functionality myself but I was unable to find out how adding validators and computers works.

Contributor

dark-light-cz commented Sep 19, 2017

Hello!
I know it's nor in standard nor in any draft but can you extend support of bleedbox to be available in 4 sizes. I expect it's not problem and is only extension and does't bkeak anything functional.
Th reason is that i use weasyprint to generate pages for printer working with SRA4(225x320 mm) paper an i need bleed mark to paper A4(210mmx297mm)
I tried to extend the functionality myself but I was unable to find out how adding validators and computers works.

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Sep 19, 2017

Member

Hi @dark-light-cz!

You want bleed to behave like padding. Good news: it's not that hard 😄.

In validation.py, you can add a decorator for bleed around the expand_four_sides function, and 4 for bleed-left/right/top/bottom around the bleed function.

In properties.py, you can add bleed-left/right/top/bottom where bleed was added in 71d5409.

In css/__init__.py, you can replace bleed by bleed(_(left|right|top|bottom))? (not tested) in RE_INITIAL_NOT_COMPUTED (bleed's initial value is 'auto' where the calculated value depends on the value of marks).

You can then use a list where bleed is used as a single value (for example in document.py), and report these values when creating the bleed box (in pdf.py).

I think that's all! If you have any questions, you can fork and push what you've done even if it doesn't work, I'll help you to solve the problems you meet!

Member

liZe commented Sep 19, 2017

Hi @dark-light-cz!

You want bleed to behave like padding. Good news: it's not that hard 😄.

In validation.py, you can add a decorator for bleed around the expand_four_sides function, and 4 for bleed-left/right/top/bottom around the bleed function.

In properties.py, you can add bleed-left/right/top/bottom where bleed was added in 71d5409.

In css/__init__.py, you can replace bleed by bleed(_(left|right|top|bottom))? (not tested) in RE_INITIAL_NOT_COMPUTED (bleed's initial value is 'auto' where the calculated value depends on the value of marks).

You can then use a list where bleed is used as a single value (for example in document.py), and report these values when creating the bleed box (in pdf.py).

I think that's all! If you have any questions, you can fork and push what you've done even if it doesn't work, I'll help you to solve the problems you meet!

@dark-light-cz

This comment has been minimized.

Show comment
Hide comment
@dark-light-cz

dark-light-cz Sep 21, 2017

Contributor

Hi @liZe

I re-wrote your implementation of bleed as you suggest in my fork in dark-light-cz@05446f5

If you like it I can create pull request.

Only thing I'm not sure with is changes in weasyprint/pdf.py. Can you please take a look at it and tell me whether it is right. I'm not sure why there is dividing by 2 in create of self.BleedBox and I'm not sure if there should be used left or right on x axis and top or bottom on y axis.

If you want my patch to included we propably need some tests. If so, please suggest me how to do it.

Contributor

dark-light-cz commented Sep 21, 2017

Hi @liZe

I re-wrote your implementation of bleed as you suggest in my fork in dark-light-cz@05446f5

If you like it I can create pull request.

Only thing I'm not sure with is changes in weasyprint/pdf.py. Can you please take a look at it and tell me whether it is right. I'm not sure why there is dividing by 2 in create of self.BleedBox and I'm not sure if there should be used left or right on x axis and top or bottom on y axis.

If you want my patch to included we propably need some tests. If so, please suggest me how to do it.

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Oct 4, 2017

Member

@dark-light-cz Sorry for the delay.

Yes, that's cool, thank you, you can create a pull request! I'll merge it and clean a couple of little things later.

Member

liZe commented Oct 4, 2017

@dark-light-cz Sorry for the delay.

Yes, that's cool, thank you, you can create a pull request! I'll merge it and clean a couple of little things later.

@liZe liZe closed this in 71d5409 Oct 5, 2017

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 9, 2017

kleink
py-weasyprint: update to 0.41.
Version 0.41
------------

Released on 2017-10-05.

WeasyPrint now depends on pdfrw >= 0.4.

New features:

* `#471 <https://github.com/Kozea/WeasyPrint/issues/471>`_:
  Support page marks and bleed.

Bug fixes:

* `#513 <https://github.com/Kozea/WeasyPrint/issues/513>`_:
  Don't crash on unsupported image-resolution values.
* `#506 <https://github.com/Kozea/WeasyPrint/issues/506>`_:
  Fix @font-face use with write_* methods.
* `#500 <https://github.com/Kozea/WeasyPrint/pull/500>`_:
  Improve readability of _select_source function.
* `#498 <https://github.com/Kozea/WeasyPrint/issues/498>`_:
  Use CSS prefixes as recommanded by the CSSWG.
* `#441 <https://github.com/Kozea/WeasyPrint/issues/441>`_:
  Fix rendering problems and crashes when using @font-face.
* `bb3a4db <https://github.com/Kozea/WeasyPrint/commit/bb3a4db>`_:
  Try to break pages after a block before trying to break inside it.
* `1d1654c <https://github.com/Kozea/WeasyPrint/commit/1d1654c>`_:
  Fix and test corner cases about named pages.

Documentation:

* `#508 <https://github.com/Kozea/WeasyPrint/pull/508>`_:
  Add missing libpangocairo dependency for Debian and Ubuntu.
* `a7b17fb <https://github.com/Kozea/WeasyPrint/commit/a7b17fb>`_:
  Add documentation on logged rendering steps.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 22, 2017

kleink
py-weasyprint: update to 0.41.
Version 0.41
------------

Released on 2017-10-05.

WeasyPrint now depends on pdfrw >= 0.4.

New features:

* `#471 <https://github.com/Kozea/WeasyPrint/issues/471>`_:
  Support page marks and bleed.

Bug fixes:

* `#513 <https://github.com/Kozea/WeasyPrint/issues/513>`_:
  Don't crash on unsupported image-resolution values.
* `#506 <https://github.com/Kozea/WeasyPrint/issues/506>`_:
  Fix @font-face use with write_* methods.
* `#500 <https://github.com/Kozea/WeasyPrint/pull/500>`_:
  Improve readability of _select_source function.
* `#498 <https://github.com/Kozea/WeasyPrint/issues/498>`_:
  Use CSS prefixes as recommanded by the CSSWG.
* `#441 <https://github.com/Kozea/WeasyPrint/issues/441>`_:
  Fix rendering problems and crashes when using @font-face.
* `bb3a4db <https://github.com/Kozea/WeasyPrint/commit/bb3a4db>`_:
  Try to break pages after a block before trying to break inside it.
* `1d1654c <https://github.com/Kozea/WeasyPrint/commit/1d1654c>`_:
  Fix and test corner cases about named pages.

Documentation:

* `#508 <https://github.com/Kozea/WeasyPrint/pull/508>`_:
  Add missing libpangocairo dependency for Debian and Ubuntu.
* `a7b17fb <https://github.com/Kozea/WeasyPrint/commit/a7b17fb>`_:
  Add documentation on logged rendering steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment