Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - crop marks
  FAQ FAQ  Forum Search   Register Register  Login Login

crop marks

 Post Reply Post Reply
Author
Message
pdfer View Drop Down
Beginner
Beginner


Joined: 13 Oct 15
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote pdfer Quote  Post ReplyReply Direct Link To This Post Topic: crop marks
    Posted: 30 Nov 15 at 10:31PM
New Debenu user here.

I've been publishing books using PDF files for some years now, but the latest twist my publisher is throwing at me (after personnel changes there) is that they want me to add crop marks to my master files. In the past, I've presented the master files without margins or crop marks, and they did whatever they needed. Now, it seems, with the personnel changes, they've forgotten how... and I never knew how...because I didn't need to know.

So lets say I generate a page of data 180mm × 110mm in image size. I want to add a margin of 9mm fore edge and 11mm gutter, and 9mm top and bottom. I further want to add enough space for crop marks... is there a standard somewhere for the distance from the trim edge where the crop mark should start, how long it should be, what line weight, etc.?

And so where would I start to do this as I create my PDF file?  Some pages will be full-page graphics (no bleed required, though), others text, if the handling should be different.
Back to Top
martin.weigl View Drop Down
Team Player
Team Player
Avatar

Joined: 23 Feb 16
Location: Upper Austria
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote martin.weigl Quote  Post ReplyReply Direct Link To This Post Posted: 23 Feb 16 at 12:26PM
Don't know if it's still interesting for you, but I had the same problem in here - adding a trimbox and cropmarks after the content has been drawn before.
 
My solution (C#):
Let' suppose, the variable trimBoxInches holds the width of the trim box
 
iterate through the pages, add a new page for every page and capture the (first) page (which removes it, so the next page is always the first):

IDictionary<int, int> pageIds = new Dictionary<int, int>();

int nrOfPages = this.Library.PageCount();
for (int page = 1; page <= nrOfPages; page++)
{
  this.Library.NewPage();
  this.Library.SelectPage(1);
  int pageId = this.Library.CapturePage(1);
  pageIds.Add(page, pageId);
}
Afterwards you can calculate the new dimensions of your pages and resize them:
double pageWidth = this.Library.PageWidth();
double pageHeight = this.Library.PageHeight();
double newPageWidth = pageWidth + 2 * trimBoxInches;
double newPageHeight = pageHeight + 2 * trimBoxInches;
 
this.Library.SetPageDimensions(newPageWidth, newPageHeight);
 
After this the captured pages can be redrawn again:
foreach (KeyValuePair<int, int> entry in pageIds)
{
  int pageNr = entry.Key;
  int pageId = entry.Value;
  this.Library.SelectPage(pageNr);
  this.Library.DrawCapturedPage(pageId, trimBoxInches, trimBoxInches + pageHeight, pageWidth, pageHeight);
 
  double trimBoxLength = trimBoxInches; // eventually you want to make the lines a little bit shorter here
  // prepare drawing
  this.Library.SetLineColorCMYK(0, 0, 0, 1);
  this.Library.SetLineWidth(...); // set the width of your cropmarks here
  // bottom left corner
  this.Library.DrawLine(0, trimBoxInches, trimBoxLength, trimBoxInches);
  this.Library.DrawLine(trimBoxInches, 0, trimBoxInches, trimBoxLength);
  // bottom right corner
  this.Library.DrawLine(newPageWidth, trimBoxInches, newPageWidth - trimBoxLength, trimBoxInches);
  this.Library.DrawLine(newPageWidth - trimBoxInches, 0, newPageWidth - trimBoxInches, trimBoxLength);
  // top right corner
  this.Library.DrawLine(newPageWidth, newPageHeight - trimBoxInches, newPageWidth - trimBoxLength, newPageHeight - trimBoxInches);
  this.Library.DrawLine(newPageWidth - trimBoxInches, newPageHeight, newPageWidth - trimBoxInches, newPageHeight - trimBoxLength);
  // top left corner
  this.Library.DrawLine(0, newPageHeight - trimBoxInches, trimBoxLength, newPageHeight - trimBoxInches);
  this.Library.DrawLine(trimBoxInches, newPageHeight, trimBoxInches, newPageHeight - trimBoxLength);
}
 
 
And, of course, you want to add a trimbox for the print office:
this.Library.SetPageBox(4, trimBoxInches, trimBoxInches, pageWidth, pageHeight);

Hth,
Martin


Edited by martin.weigl - 23 Feb 16 at 12:35PM
Back to Top
martin.weigl View Drop Down
Team Player
Team Player
Avatar

Joined: 23 Feb 16
Location: Upper Austria
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote martin.weigl Quote  Post ReplyReply Direct Link To This Post Posted: 23 Feb 16 at 12:31PM

Add: "this.Library." is the reference you normally find as "QP.". Guess you might already have figured that out Smile

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store