Jump to content

Error Imposed randoms


Susan

Recommended Posts

I am using a JavaScript Globals:

 

versions = {};

 

and a OnRecordStart rule:

 

var isProof = true; // false to compose job normally

var version = Field("list"); // Field that indicates version

if (isProof) {

if (!versions[version])

versions[version] = 0;

FusionPro.Composition.composeThisRecord = ++versions[version] <= 1;

}

 

which I found on the forum to compose one copy of each unique entry in a Field. It works great when composing without a FusionPro Imposition, but when I try to add an imposition and compose I get the following error:

 

A fatal error has occurred and FusionPro must abort. It is possible the disk is full.

Composition stopped with errors. Error no. 1096.

 

and this message in the log:

 

A blank page is emitted since no record is composed properly.

dlpdfdocwritepdf, progress "Doc->PageCount is zero", error: Bad parameter.

PDF Library Document Write Error: Bad parameter.

pdf_om_WriteDoc, dtl_pdf_WritePdf returned "-2"

 

Will it be possible to compose using an FP Imposition template with the JavaScript Globals and OnRecordStart rules?

Link to comment
Share on other sites

It's hard to know for sure without seeing the job, but I suspect that you're using stacked imposition, and the count for each value of the "list" field is getting set in the preprocessing step, so that when you get to the actual composition step, it thinks every value has been composed, so all the records get skipped and nothing is output.

 

So you need to clear out the versions object and reset all the counts to zero between the preprocessing step and the actual composition. Probably the easiest way to do this is to add this at the beginning of OnRecordStart:

if (FusionPro.Composition.processedRecordNumber() == 1)
   versions = {};

Regarding this question in general:

Will it be possible to compose using an FP Imposition template with the JavaScript Globals and OnRecordStart rules?

Yes, of course it's possible. Many jobs use OnRecordStart rules and JavaScript Globals with imposition. You just happen to have run into a very specific case where you're using your own custom logic to drive the composition and determine which records are output, and specifically doing your own aggregation of the data, which happens to need a slight tweak to account for the proprocessing run performed with stacked imposition.

Link to comment
Share on other sites

You were correct about the stacking, when removed from the FP Imposition it will compose.

 

I tried adding the new code:

 

if (FusionPro.Composition.processedRecordNumber() == 1)

versions = {};

 

to the beginning of the OnRecordStart but I am getting an error.

 

"TypeError: FusionPro.Composition.processedRecordNumber is not a function"

 

Can you show me where it should be added to this:

 

var isProof = true; // false to compose job normally

var version = Field("list"); // Field that indicates version

if (isProof) {

if (!versions[version])

versions[version] = 0;

FusionPro.Composition.composeThisRecord = ++versions[version] <= 1;

}

 

Thanks

Link to comment
Share on other sites

You were correct about the stacking, when removed from the FP Imposition it will compose.

 

I tried adding the new code:

 

if (FusionPro.Composition.processedRecordNumber() == 1)

versions = {};

 

to the beginning of the OnRecordStart but I am getting an error.

 

"TypeError: FusionPro.Composition.processedRecordNumber is not a function"

 

Can you show me where it should be added to this:

 

var isProof = true; // false to compose job normally

var version = Field("list"); // Field that indicates version

if (isProof) {

if (!versions[version])

versions[version] = 0;

FusionPro.Composition.composeThisRecord = ++versions[version] <= 1;

}

 

Thanks

Sorry, that was a typo. It should be:

if (FusionPro.Composition.processedRecordNumber == 1)
   versions = {};

And it should go right at the top of OnRecordStart, before the other code.

Link to comment
Share on other sites

Thanks Dan.

 

I added the code to the OnRecordStart and it composed the imposed file. The only problem now is that it only composed one press sheet. The imposition is 3up 2sided and there are 11 unique entries in the field so it should have composed 4 press sheets. Any thoughts on what else I might need to correct.

Link to comment
Share on other sites

I added the code to the OnRecordStart and it composed the imposed file. The only problem now is that it only composed one press sheet. The imposition is 3up 2sided and there are 11 unique entries in the field so it should have composed 4 press sheets. Any thoughts on what else I might need to correct.

Further analysis is impossible without the job files.

Link to comment
Share on other sites

The problem is that when FusionPro preprocesses the job, the "processedRecordNumber" is zero-indexed (the first record is 0) but when it composes the job the first record is "1". FusionPro preprocesses the job to determine how to layout the records on the imposition you've defined for the job. So on the first record (record 0 during preprocessing) it checks the 'versions' object for the version and adds it. Then on the second record (record 1 during preprocessing), it resets the 'versions' object, checks for the version and determines that record 2 should also print even though they're the same version.

 

Ultimately, the issue is that FP gets confused when the layout determined during preprocessing doesn't match what the template is saying should print during composition.

 

The fix is to only reset the 'versions' object if FusionPro is done preprocessing:

if (FusionPro.Composition.processedRecordNumber == 1[color="Red"] && !FusionPro.Composition.inPreprocessing[/color])
 versions = {};

var isProof = true;          // false to compose job normally
var version = Field("list"); // Field that indicates version
if (isProof) {
 if (!versions[version])
   versions[version] = 0;
 FusionPro.Composition.composeThisRecord = ++versions[version] <= 1;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...