How do I split a document into sub-documents with the same number of pages?

I have LinePrinter data for Statements. Each statement can be from 1 to 30 pages. As this is replacing pre-printed stationery my data mapper is simple and simply maps blocks of text from every page.

In the workflow I would like to output all the single page statements, then all the 2 page ones, and so on. In Suite I would have done this by creating metadata, adding a Document level in the metadata when the account number changed, using a metadata filter to extract single pages, 2 pages, etc., and running this through a template.

I’m trying the same approach but the filter doesn’t appear to work as I end up with a PDF with all the pages in it. How can I filter out statements which have the same number of pages per set?

This doesn’t work exactly as in Planet Press Suite. I would need to see your data, the way you mapped it, how it is set-up in the template.

Are you data sensitive? Can you post us your complete packgage?

If so, in your Connect Design tool, when you send to Workflow, instead of selecting the Workflow PC name, select “Send to file”. That will create a package file. Upload it here and we will look at it.

https://learn.objectiflune.com/qa-blobs/12711025370126909673.zip

__T__hank you. I’ve uploaded the package.

Here is how you do it in Connect:

It will be a 2 steps processes…kind of…

Basically it will look something like this in Workflow:

  • Input
  • Datamapping
  • CreatePrint context
  • JobCreation
  • OutputCreation
  • Datamapping
  • CreatePrint Context
  • JobCreation
  • OutputCreation

Now more in details:

The first DataMapping will be the one you’re actually using. The first CreatePrint Context as well.

The first JobCreation will be set to Sort based on your Account Number.

The first OutputCreation will be a simple PDF output using ThroughWorkflow.

The second DataMapping will use the newly created PDF as its input.

The second CreatePrint Context (a new Template) will only have the newly created PDF has a background

The second JobCreation will use grouping, PageBreak, on DocumentSet level

The second OutputCreation will use Separation at the DocumentSet level.

A little explanation:

First you are creating the PDF of your output that is sorted by Account Number. This will regroup all pages by Account Number.

That PDF is then used as the input of the second DataMapping/Template. In that DataMapping, your Boundaries Trigger will be On Text and the Operator will be On Changes. Of course the text you will be looking at his your Account Number. That will result in each records being of 1 to multiple PDF pages, already grouped by Account Number.

Then in your second JobCreation, you are doing a PageBreak on the DocumentSet level which will group all your documents by page range.

Hope all is clear…feel free to comments or ask more questions.

Thank you for this. I have tried creating the new Job Creations and Output Creations. It all works until the second Job Creation where I get the following error -

W3001 : Error while executing plugin: HTTP/1.1 500 Internal Server Error LoggedApplicationException: There was an error running the job creation process caused by JPQLException:
Exception Description: Syntax error parsing [ SELECT DISTINCT contentitem FROM ContentItem contentitem JOIN contentitem.contentFile.contentSet contentset JOIN contentitem.dataRecord datarecord JOIN FETCH contentitem.dataRecord , (SELECT pagesitem.id, SUM((pagespages.rangeEnd - pagespages.rangeStart) + 1) pagecount, CASE ELSE 0 END pagebreakrange FROM ContentItem pagesitem JOIN pagesitem.contentSections pagessection JOIN pagessection.contentPages pagespages GROUP BY pagesitem.id) pagecounts WHERE contentItem.contentFile.contentSet.dateCreated >= ‘2000-01-01’ AND contentitem.contentFile.contentSet.id IN ( 244006 ) AND pagecounts.id = contentitem.id ORDER BY pagecounts.pagebreakrange ASC, datarecord.insertOrder ASC , contentitem.sortOrder ASC].
[275, 275] A CASE expression must define at least one WHEN clause. (SRV000032)
Create Job: W1603 : Plugin failed - 13:34:00 (elapsed time: 00:00:00:172)

I have “Use Grouping” selected on the first screen. I then have Page Break Grouping at the Document Set level selected on the following screen. Any ideas as to what is going wrong would be appreciated.

I cannot reproduce the behavior you are getting.

Look back into the steps I provided before and try to re-create them exactly, in the same order, without adding anything else.

Example: In the second jobCreation, do not add a grouping by AccountNumber in any of the level.