Crop marks not showing if slot is empty

Hi,

I have a fairly complex Javascript based imposition that I’m having difficulties with the crop marks.

The process plan can be downloaded here

This is a dynamic N-up imposition that, based on document size, it calculates how many slots can fit on the sheet’s printable area and if the best layout should be portrait or landscape (whichever fits more).

The actual imposition will repeat “imposition.addPage()” for as many slots were calculated:

do {
	...
	for (let row = 0; row < numRows; row++) {
		for (let col = 0; col < numCols; col++) {
	...

The problem I’m having is that the crop marks are not showing if I run out of pages in the pdf.

Is there a way to to insert a blank page (something like: if currentIndex>lastPage add blank) or fill the empty slot background with white so it will add the rest of the cop marks even if there are no actual pages left?

I guess I would try to take out from Imposition Action part where You calculate “total” amount that can be imposed. I would put that before imposition Action as an variable calcuation. Then You could subtract from “total” the amount that file has and apply arbitrary javascript fixup that would add missing white pages to original document (before imposition). I think it’s not possible to add white pages inside Imposition action. That should be done outside, as much as I know.

Hi Adrian,

Interesting, I actually thought it was going to place the marks anyway, even if no page was placed in the slot, but I just double-checked that that isn’t the case…

So, yes, you could of course use the white page technique, but what @Aldis says is also correct, that needs to be done outside of the imposition part (which would be relatively simple in a process plan).

Or you could draw the marks using imposition decorations, which gives you full control what lines you want and where, but you then need to do the calculations yourself…

Interesting use case, and a feature request I think!

Thank you both.

Yes, definitely a feature request. I’ll add it to the feature request section.

1 Like

Hi,

Sorry to “reopen” this thread.

I’m trying to add the blank pages before the imposition section as suggested, by adding:

let cfg = {
   "insert_page" : {
      "comment" : "",
      "config" : [
         {
            "params" : {
               "apply_to" : {
                  "isCheck" : true,
                  "value" : "Is last page"
               },
               "copies" : 2,//this will the variable for number of empty slots
               "copy_page_content" : false,
               "except_page_objects" : "none",
               "insert" : "after_each_page"
            }
         }
      ],
      "custom_id" : "",
      "name" : "Insert blank pages",
      "scope" : {
         "current_file" : true,
         "embedded_files" : false,
         "processing_steps" : "ps_and_non_ps"
      }
   }
}
;
cfg;

Although this code works in a standalone Fixup, it doesn’t add the pages in the imposition script if placed before “new Impose()”.

When you say

Do you mean it needs to be done as a separate step in a process plan? We were hoping to use --mergeimpose and send just a .json file with variables, an imposition.js with the files to be merged and imposed.

Indeed, you need to do it as a separate Process Plan step. It’s not possible to add this to the imposition script…