Page 1 of 1
					
				Crop marks using Chemistry
				Posted: Fri Jan 26, 2024 10:28 am
				by horisonten
				Hello, is there an easy way of adding crop marks to the PDF when using the built in PDF transformation?
If I were to use Prince I could add this to my CSS:
Code: Select all
@media print {
  @page {
    marks: crop cross;
  }
}
But is there something like this that I can use with Chemistry?
 
			 
			
					
				Re: Crop marks using Chemistry
				Posted: Fri Jan 26, 2024 10:56 am
				by julien_lacour
				Hello,
Currently Oxygen PDF Chemistry doesn't support crop marks display in PDF, I added a feature request in our tracking system.
When it will be available, I will post on this topic.
Regards,
Julien
			 
			
					
				Re: Crop marks using Chemistry
				Posted: Fri Jan 26, 2024 11:30 am
				by horisonten
				julien_lacour wrote: ↑Fri Jan 26, 2024 10:56 am
Hello,
Currently Oxygen PDF Chemistry doesn't support crop marks display in PDF, I added a feature request in our tracking system.
When it will be available, I will post on this topic.
Regards,
Julien
 
All right! Thanks for adding it to the wish list.
Is there a workaround meanwhile? 
Can I "inject" a snippet of XEP into the transformation for example?
As seen in this topic: 
post6339.html?hilit=crop%20marks#p6339 
			 
			
					
				Re: Crop marks using Chemistry
				Posted: Mon Jan 29, 2024 1:14 pm
				by julien_lacour
				Hello,
A workaround for this could be to use an SVG file as background for the whole PDF, I already did an example:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" width="8.5in" height="11in" viewBox="0 0 85 110">
    <!-- 
        The viewbox is based on the US-LETTER size with 1in margins except 1in = 10 for the viewport.
    -->
    <style type="text/css">
        .line { fill:none; stroke:black; stroke-width:0.1 }
        .circle { fill:none; stroke:black; stroke-width:0.1 }
    </style>
    <g id="cut-marks">
        <!-- TOP-LEFT-CORNER -->
        <polyline class="line" points="4,10 9,10"/>
        <polyline class="line" points="10,4 10,9"/>
        <!-- TOP-RIGHT-CORNER -->
        <polyline class="line" points="76,10 81,10"/>
        <polyline class="line" points="75,4 75,9"/>
        <!-- BOTTOM-LEFT-CORNER -->
        <polyline class="line" points="4,100 9,100"/>
        <polyline class="line" points="10,101 10,106"/>
        <!-- BOTTOM-RIGHT-CORNER -->
        <polyline class="line" points="76,100 81,100"/>
        <polyline class="line" points="75,106 75,101"/>
    </g>
    <g id="registration-marks">
        <!-- TOP-LEFT-CORNER -->
        <polyline class="line" points="3,5 6,5"/>
        <polyline class="line" points="4.5,3.5 4.5,6.5"/>
        <circle class="circle" cx="4.5" cy="5" r="1.3"/>
        <circle cx="4.5" cy="5" r="0.8"/>
        <!-- TOP-RIGHT-CORNER -->
        <polyline class="line" points="79,5 82,5"/>
        <polyline class="line" points="80.5,3.5 80.5,6.5"/>
        <circle class="circle" cx="80.5" cy="5" r="1.3"/>
        <circle cx="80.5" cy="5" r="0.8"/>
        <!-- BOTTOM-LEFT-CORNER -->
        <polyline class="line" points="3,105 6,105"/>
        <polyline class="line" points="4.5,103.5 4.5,106.5"/>
        <circle class="circle" cx="4.5" cy="105" r="1.3"/>
        <circle cx="4.5" cy="105" r="0.8"/>
        <!-- BOTTOM-RIGHT-CORNER -->
        <polyline class="line" points="79,105 82,105"/>
        <polyline class="line" points="80.5,103.5 80.5,106.5"/>
        <circle class="circle" cx="80.5" cy="105" r="1.3"/>
        <circle cx="80.5" cy="105" r="0.8"/>
    </g>
</svg>
This example works for US-LETTER size but you can basically adapt it to other page size by changing the coordinates.
You can also use any other unit instead of inches, centimeters or millimeters should work as well.
Once you have the correct SVG, you just need to declare it as background-image for all pages:
Code: Select all
@page {
  background-image: url("file:/path/to/marks.svg");
  background-repeat: no-repeat;
}
And you will obtain something similar to this:
marks.png
Regards,
Julien
 
			 
			
					
				Re: Crop marks using Chemistry
				Posted: Thu Feb 01, 2024 12:15 pm
				by horisonten
				Thanks for the suggestion! That should suffice for now  

 
			 
			
					
				Re: Crop marks using Chemistry
				Posted: Wed Mar 27, 2024 5:56 pm
				by julien_lacour
				Hello,
Starting with Oxygen 26.1 (already available on our website) it is possible to control the marks display from the CSS.
For more information you can check the 
Page Boundaries topic from our user guide.
Regards,
Julien
 
			 
			
					
				Re: Crop marks using Chemistry
				Posted: Wed Apr 03, 2024 1:40 pm
				by InspectorSpacetime
				Hi,
The crop marks are a great feature, thanks for that!
However, I'm trying to wrap my head around how to properly use them with page margins. Correct me if I'm wrong, but by default the crop marks would cut the page margin boxes out, like in the image below (no crop values declared, so the default 
media-box is used): 
crop.png
So if I want to include the margin boxes in the finished cut, the bleed value should be the same as the page margins, which results in this:
crop2.png
Or am I not getting something?
And is there any difference between using 
bleed or 
-oxy-crop-offset?
 
			 
			
					
				Re: Crop marks using Chemistry
				Posted: Wed Apr 03, 2024 4:37 pm
				by julien_lacour
				Hello,
You're right, by default the crop marks will cut the margins out and you're right again if you want to include the margin boxes in the finished cut, the bleed or -oxy-crop-offset value should be the same as the page margins.
Regarding bleed vs -oxy-crop-offset, when using 
media-box (default) you can use any of the properties.
If you change the -oxy-crop-box value or use both properties, the behavior is as follows:
Note: If only one of the properties is present, its value will be used. If both are set, then:
-  If the crop box is set to media-box (default), the bigger value will be used.
 
-  If the crop box is set to bleed-box, only the bleed value will be used.
 
-  If the crop box is set to trim-box (finished page), no value will be used.
 
 
This note is taken from the Page Boundaries topic I linked in my previous post.
Regards,
Julien