Page 1 of 1

trimbox for many page

Posted: Wed Jan 15, 2025 3:39 pm
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.

Re: trimbox for many page

Posted: Wed Jan 15, 2025 4:33 pm
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?

Re: trimbox for many page

Posted: Thu Jan 16, 2025 9:31 am
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.

Re: trimbox for many page

Posted: Thu Jan 16, 2025 9:35 am
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.

Re: trimbox for many page

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

Code: Select all

https://www.enfocus.com/en/appstore/product/fastlane

Re: trimbox for many page

Posted: Thu Jan 16, 2025 9:54 am
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

Re: trimbox for many page

Posted: Thu Jan 16, 2025 9:57 am
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

Re: trimbox for many page

Posted: Thu Jan 16, 2025 9:57 am
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

Re: trimbox for many page

Posted: Thu Jan 16, 2025 10:03 am
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

Re: trimbox for many page

Posted: Thu Jan 16, 2025 10:03 am
by Krzysztof Mycek
Thank You Freddy.
I used a very similar method but using a callas report and script in Switch.

Re: trimbox for many page

Posted: Thu Jan 16, 2025 10:05 am
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.

Re: trimbox for many page

Posted: Thu Jan 16, 2025 11:00 am
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.

Re: trimbox for many page

Posted: Thu Jan 16, 2025 11:01 am
by Krzysztof Mycek
Thank You for Your help

Re: trimbox for many page

Posted: Thu Jan 16, 2025 11:03 am
by loicaigon
My answer was sent and I missed that other folks provided similar answers.
still hope it can help.

Re: trimbox for many page

Posted: Thu Jan 16, 2025 11:28 am
by Krzysztof Mycek
Yes all answer are useful. Thank You