At the moment , I do not see how that would be possible other than by cropping the original PDF input. Unfortunately, that would require the use of an external library or application.
I will make a feature request to our R&D department and see if it gets accepted. The more customer request the feature, the more chance it has to make a future release.
Do you know it this feature has yet been implemented ?
Just have another customer, where I need to remove the letterhead on page 2-N
The PDF arrives from the “pdf datamapper input” and i have to “blank” out the top 10 cm on page 2-N, to make the datamapping a lot easier.
The request has been made but it is yet to be implemented. If you want you can message me the customer name and I will add it to the list of requester.
Hope you can help in another way in this case.
Need to control up to 3 different sections depending on input from the datamapper.
At first I only needed to control 2 sections depending on the page index.
Now I need a to control a third section, depending on a variable in a detailed table and the page index.
Is that posible ?
Have a detailed table with the info, each record in the table is equal to a corresponing page.
record.Project[1] = Page 1 from the PDF datamapper input
Have a control script, put I’m missing the path with the “page.index = record.index” if it is posible
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var Section000mm = merge.template.contexts.PRINT.sections.PageOffset000mm;
var Section105mm = merge.template.contexts.PRINT.sections.PageOffset105mm;
var Section120mm = merge.template.contexts.PRINT.sections.PageOffset120mm;
Section000mm.enabled = false;
Section105mm.enabled = false;
Section120mm.enabled = false;
//var PageIndex = record.fields[“RecordIndex”]; //Old datamapper with page.index var PageIndex = record.fields.Project ??? //Page var ProjectID = record.fields.Project ??? //ProjectID
I don’t fully understand what you try to achieve but I believe you want to iterate over the records in the detail table. Perhaps the following is of some help:
var theSections = merge.template.contexts.Print.sections;
theSections["Section 1"].enabled = false;
theSections["Section 2"].enabled = false;
theSections["Section 3"].enabled = false;
for( var i = 0; i < record.tables['project'].length; i++ ){
var projectId = record.tables.project[i].fields.ProjectID;
var pageIdx = record.tables.project[i].fields.Page;
// your logic here
}
I have in this example a 24 page input pdf
Some of the pages need to be cropped.
I have made a datamapper, with a detailed table (don’t know if that can be used at all)
The input PDF just passed through as a “overlay”
On page 1 from the input PDF, it should select a print section depending on the value in record.project [1]
The “for” sentence is not working.
Ok, I think there is alternative approach… admittedly it is a bit unconventional and an extension of what Phil suggested (use clip() in CSS). In essence you would only need a single section, the background of that section is set to the Data Mapper input.
Subsequently create a User Script that targets the tag. The script iterates over the detail records and dynamically adds a CSS rule to crop the images used for the background. One for each page (based on your detail table). Again a bit unconventional and perhaps non trivial but I think it will do the job.
Below my script (you may need to tinker the conditions a bit). The screen below shows the document in Design and Preview mode.
Erik
var projects = record.tables.project;
var css = "< style>";
for( var i = 0; i < projects.length; i++ ) {
var pageIdx = projects[i].fields.Page;
var projectID = projects[i].fields.ProjectID;
if (pageIdx == 1) {
// dont do a thing.
} else if (( pageIdx > 1 ) && ( pageIdx % 2) && projectID ) {
css += ".page_bleedbox:nth-child(" + pageIdx + ") .ol_pdf_datamapper_input { clip: rect(15mm,auto,auto,auto) !important; }";
} else if ( ! projectID ) {
css += ".page_bleedbox:nth-child(" + pageIdx + ") .ol_pdf_datamapper_input { clip: rect(20mm,auto,auto,auto) !important; }";
} else {
// something else.
}
}
css += "< /style>";
results.append( css );
Just worked with the PDF.
Looks like it is not working as expected.
Needed to blank out the top so that the datamapper could not see the former text in the top.
The PDF looks allright, but the text is still there, så even though the pdf looks blank, it is not.
Must be the “bleedbox” who just blnaks it, but not removing the text.
Then the datamapper can’t skip the section - any idears. ?
Wasn’t aware of that requirement. The Designer does not remove the content from the PDF it only changes the viewable area. I wonder if shifting the page up would solve things, but I’m not sure. In that case you should be able to translate() instead of clip(). Other than that I ran out of ideas.
Tried this syntax, but It does not seem to do anything
Bleed - Working - But don’t remove text just makes it ivisible.
css += “.page_bleedbox:nth-child(” + pageIdx + “) .ol_pdf_datamapper_input { clip: rect(122mm,auto,auto,auto); !important; }”;
Move - does not work:
css += “.page_bleedbox:nth-child(” + pageIdx + “) .ol_pdf_datamapper_input { transform: translate(0,122mm); !important; }”;