trimbox for many page

Post Reply
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

trimbox for many page

Post by Krzysztof Mycek »

I am looking for a solution that can provide me with information about the TrimBox for each page in a multi-page document, as the dimensions may vary between pages.
From what I see, the Switch mechanism using the Stats method only returns the TrimBox for the first page. I’ve tried every solution I could think of, but nothing seems to work.
Does anyone have an idea how to solve this?

Commands:
[Stats.TrimBoxWidth:Path=′/Document[1]/Page[1]',Type=′Effective′] are not working.
loicaigon
Advanced member
Posts: 524
Joined: Wed Jul 10, 2013 10:22 am

Re: trimbox for many page

Post by loicaigon »

Before we go to any solution, can you tell more about the need?

Is it that you want to check that all pages get the same dimensions? Or really report every page dimensions whatever they are?
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

Re: trimbox for many page

Post by Krzysztof Mycek »

Hie Loric
I would like to report information on the size of the TrimBox for each page.
Of course, I can save this in a preflight report and extract this information from it, but I am looking for a method in which I can read this directly in Switch using the Stats method.
jan_suhr
Advanced member
Posts: 666
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: trimbox for many page

Post by jan_suhr »

With scripting module you could do it.

It's easy with a prfelight XML-report and with XSLT you can get what you want.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
freddyp
Advanced member
Posts: 1098
Joined: Thu Feb 09, 2012 3:53 pm

Re: trimbox for many page

Post by freddyp »

There is an app for that:

Code: Select all

https://www.enfocus.com/en/appstore/product/fastlane
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

Re: trimbox for many page

Post by Krzysztof Mycek »

Jan. I know.
That's exactly what I did and this xml pulls this data but it requires a script to be written. I thought that there is a simpler method directly in the Switch using the Stats parameters, but I see that it can not be done because the Switch always returns information about the first page of the document and it is not possible with this method to extract information about subsequent pages in a similar way as I showed in the first post, using the corresponding line XLS
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

Re: trimbox for many page

Post by Krzysztof Mycek »

freddyp wrote: Thu Jan 16, 2025 9:51 am There is an app for that:

Code: Select all

https://www.enfocus.com/en/appstore/product/fastlane
Sure Freddy, but this requires PitStopServer
But thank You for the idea
User avatar
JimmyHartington
Advanced member
Posts: 384
Joined: Tue Mar 22, 2011 7:38 am

Re: trimbox for many page

Post by JimmyHartington »

I have tried to use AI to create an XLST which can process the XML-report from Pitstop Server.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" indent="yes"/>

    <xsl:template match="/">
        <html>
        <head>
            <title>TrimBox Information</title>
            <style>
                table {
                    width: 50%;
                    border-collapse: collapse;
                    margin: 20px auto;
                }
                th, td {
                    border: 1px solid black;
                    padding: 10px;
                    text-align: center;
                }
                th {
                    background-color: #f2f2f2;
                }
            </style>
        </head>
        <body>
            <h1 style="text-align:center;">TrimBox Information</h1>
            <table>
                <thead>
                    <tr>
                        <th>Page</th>
                        <th>Width (mm)</th>
                        <th>Height (mm)</th>
                    </tr>
                </thead>
                <tbody>
                    <xsl:for-each select="EnfocusReport/PageBoxInfo/Page">
                        <xsl:apply-templates select="TrimBox"/>
                    </xsl:for-each>
                </tbody>
            </table>
        </body>
        </html>
    </xsl:template>

    <xsl:template match="TrimBox">
        <tr>
            <td><xsl:value-of select="../@index"/></td>
            <td><xsl:value-of select="@width"/></td>
            <td><xsl:value-of select="@height"/></td>
        </tr>
    </xsl:template>
</xsl:stylesheet>
And it gives a log file which can be renamed to .html and then gives this content:
Image
jan_suhr
Advanced member
Posts: 666
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: trimbox for many page

Post by jan_suhr »

Krzysztof Mycek wrote: Thu Jan 16, 2025 9:57 am Sure Freddy, but this requires PitStopServer
But thank You for the idea
Do you have pdfToolbox. You can do a process plan that check this
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

Re: trimbox for many page

Post by Krzysztof Mycek »

Thank You Freddy.
I used a very similar method but using a callas report and script in Switch.
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

Re: trimbox for many page

Post by Krzysztof Mycek »

jan_suhr wrote: Thu Jan 16, 2025 10:03 am
Krzysztof Mycek wrote: Thu Jan 16, 2025 9:57 am Sure Freddy, but this requires PitStopServer
But thank You for the idea
Do you have pdfToolbox. You can do a process plan that check this
Yes Jan. I did it with callas.
And it all agrees that this is the way to do it. I was just asking if it could be done more simply. For the future. Unfortunately, I did not find this in the Switch documentation, hence the question here.
loicaigon
Advanced member
Posts: 524
Joined: Wed Jul 10, 2013 10:22 am

Re: trimbox for many page

Post by loicaigon »

Hi Jan,

Indeed, that's a possible approach. One that can be even better is to use the FastLane App:
https://www.enfocus.com/en/appstore/pro ... redirect=1
Image

For info, like page boxes, it will be quicker than running a preflight.

Image

And you get FastLane info as metadata:
Image

If you want something less verbose, you can use a specific pattern in the query:
Image

which will result in the following:
Image

Note that in this file, not all pages have a trimbox set. So you only see info when one is found.
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

Re: trimbox for many page

Post by Krzysztof Mycek »

Thank You for Your help
loicaigon
Advanced member
Posts: 524
Joined: Wed Jul 10, 2013 10:22 am

Re: trimbox for many page

Post by loicaigon »

My answer was sent and I missed that other folks provided similar answers.
still hope it can help.
Krzysztof Mycek
Member
Posts: 39
Joined: Tue Mar 03, 2020 11:28 am

Re: trimbox for many page

Post by Krzysztof Mycek »

Yes all answer are useful. Thank You
Post Reply