Duplicate PDF by using Quite hot impose

Post Reply
Richard#250211
Newbie
Posts: 4
Joined: Tue Feb 11, 2025 1:45 pm

Duplicate PDF by using Quite hot impose

Post by Richard#250211 »

Hi everybody,

First post here, im very new to Switch and trying to learn.

Im trying to use the number in the input filename to set the number of copies.
Sample filenames can look like these SamplePDF-50x.pdf or AnotherSample-1000x.pdf
I made a simple flow using the Quite hot impose app, and a controll xml, this seems to work ok but the number of copies is static and needs to become variabel.

Im not very proficient with coding and im strugling with the next parts:

- Extracting the number of copies from the filename --> (the number is always after a -)
- correctly using the variabel in the controll xml

I tried this in the xml file, but didnt work:

<?xml version="1.0" encoding="UTF-8" ?>
<QUITEXML xmlns="http://www.quite.com/general/ns/quitexml/">
<ITEMS>
<DICT N='0'> <ITEMS>
<A N='Category'>OneCommand_V1</A>
<A N='Command'>PageTools</A>
<DICT N='Desc'> <ITEMS>
<S N='0'>Action: Duplicate pages</S>
<S N='1'>Range: all pages</S>
<S N='2'>Copies: X</S>
<S N='3'>Collate: yes</S>
</ITEMS> </DICT>

<DICT N='Params'> <ITEMS>
<A N='Action'>DuplicatePages</A>
<B N='Collate'>1</B>
<I N='Copies'>[Job.Name:Search="SamplePDF-(\d+)x\.pdf$" Replace="$1"]</I>
<I N='PosX'>693</I>
<I N='PosY'>268</I>
<S N='Requires'>qi3alphabase[QI 3.0/QHI 3.0 alpha]</S>
<DICT N='Source'> <ITEMS>
<DICT N='Range'> <ITEMS>
<A N='RangeType'>AllDoc</A>
</ITEMS> </DICT>

</ITEMS> </DICT>

</ITEMS> </DICT>

<DICT N='Provider'> <ITEMS>
<S N='Code'>QITE_CMDLINE1</S>
<S N='FullName'>Quite Hot Imposing</S>
<S N='Name'>Quite Hot Imposing</S>
<I N='Version'>1</I>
</ITEMS> </DICT>

<I N='Version'>1</I>
</ITEMS></DICT>

<A N='Category'>CommandList_V1</A>
<B N='DoPrompt'>0</B>
<S N='Requires'>qi2base</S>
<DICT N='Stats'> <ITEMS>
<S N='Created'>D:20250211095800</S>
</ITEMS></DICT>

<A N='UIMode'>None</A>
</ITEMS>
</QUITEXML>

Can someone help me shed some light on how to do this?

Thanks! :D

Cheers Richard
Absolute Enfocus Switch beginner!

We are using: Pitstop/Quite Hot Impose/Enfocus Switch
User avatar
tdeschampsBluewest
Member
Posts: 114
Joined: Tue Jun 01, 2021 11:57 am

Re: Duplicate PDF by using Quite hot impose

Post by tdeschampsBluewest »

Hi,

To achieve this, you will need to use an app to generate the XML file, such as CreateLog.

However, there’s a caveat when adding metadata—it can break due to the following part:

Code: Select all

<S N='Requires'>qi3alphabase[QI 3.0/QHI 3.0 alpha]</S>
The issue stems from the brackets, as Switch interprets them as variables.
Fortunately, with the latest versions of CreateLog, there's a feature that automatically replaces brackets to avoid this issue.

Regarding your variable, it wont work as is since "Replace" is not a keyword in switch metadata.
Assuming your file look something like : SamplePDF-18x.pdf, your best bet is to look after digit followed by x.pdf$

Code: Select all

[Job.Name:Search="\d+(?=x.pdf$)"]


On a side note, some of your lines in the Xml are optional and not needed for quite with Switch, here is a simplified Xml with updated variable:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<QUITEXML xmlns="http://www.quite.com/general/ns/quitexml/">
    <ITEMS>
        <DICT N='0'>
            <ITEMS>
                <A N='Category'>OneCommand_V1</A>
                <A N='Command'>PageTools</A>
                <DICT N='Params'>
                    <ITEMS>
                        <A N='Action'>DuplicatePages</A>
                        <B N='Collate'>1</B>
                        <I N='Copies'>[Job.Name:Search="\d+(?=x.pdf$)"]</I>
                        <I N='PosX'>693</I>
                        <I N='PosY'>268</I>
                        <DICT N='Source'>
                            <ITEMS>
                                <DICT N='Range'>
                                    <ITEMS>
                                        <A N='RangeType'>AllDoc</A>
                                    </ITEMS>
                                </DICT>

                            </ITEMS>
                        </DICT>
                    </ITEMS>
                </DICT>
                <I N='Version'>1</I>
            </ITEMS>
        </DICT>
        <A N='Category'>CommandList_V1</A>
        <B N='DoPrompt'>0</B>
        <S N='Requires'>qi2base</S>
        <A N='UIMode'>None</A>
    </ITEMS>
</QUITEXML>

That said, while it’s possible to handle everything with CreateLog and the basic Quite app (and we’ve been doing so for years), it can be quite cumbersome, especially when dealing with size and dimension conversions, particularly for gutters.
To simplify these scenarios, and fasten integration we’ve developed an internal app that was just released a few days ago—Quite Helper.


Do not hesitate if you have any question!
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Richard#250211
Newbie
Posts: 4
Joined: Tue Feb 11, 2025 1:45 pm

Re: Duplicate PDF by using Quite hot impose

Post by Richard#250211 »

Thanks for the reply,

For my first try i did:
I create the controll xml by making a sequence in Quite (local or server), then exporting this sequence. It creates the xml from my first post.

My plan was to:
1) create a basic sequence and export it from qi creating the controll xml i use in the enfocus Qi app
2) change/e3dit the xml manualy and change specific values in the xml by inkjecting/adding a Switch variable to the xml
3) use this editted xml as controll file in my flow.

I will try testing with the suplied info, thanks!

Cheers Richard,
Absolute Enfocus Switch beginner!

We are using: Pitstop/Quite Hot Impose/Enfocus Switch
User avatar
tdeschampsBluewest
Member
Posts: 114
Joined: Tue Jun 01, 2021 11:57 am

Re: Duplicate PDF by using Quite hot impose

Post by tdeschampsBluewest »

Richard#250211 wrote: Tue Mar 04, 2025 3:54 pm
2) change/e3dit the xml manualy and change specific values in the xml by inkjecting/adding a Switch variable to the xml
If you use a specific XML with the "Control XML source" set to a static "Control file" path, it won't take variable in that XML in account and fail :(
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Richard#250211
Newbie
Posts: 4
Joined: Tue Feb 11, 2025 1:45 pm

Re: Duplicate PDF by using Quite hot impose

Post by Richard#250211 »

Thanks for the help so far!

Im saving the xml localy on the server at this moment, and in the Qi app under: "Control XML source" i choose "Control file", than i select the provided XML. The flow doesnt produce an error, only the outcome is always 1 copy/duplicate no matter the filename i put in.

Does this have to do with what you explained about the statis control filepath? I tried the same xml only replaced the variabel for actual numbers and that worked, so looks like the variabel isnt accepted?

Richard
Absolute Enfocus Switch beginner!

We are using: Pitstop/Quite Hot Impose/Enfocus Switch
User avatar
tdeschampsBluewest
Member
Posts: 114
Joined: Tue Jun 01, 2021 11:57 am

Re: Duplicate PDF by using Quite hot impose

Post by tdeschampsBluewest »

Richard#250211 wrote: Wed Mar 05, 2025 9:18 am Does this have to do with what you explained about the statis control filepath? I tried the same xml only replaced the variabel for actual numbers and that worked, so looks like the variabel isnt accepted?

Exactly, variables are not allowed inside a static file since switch wont interpret it.
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
wwstudios
Newbie
Posts: 11
Joined: Tue Mar 12, 2024 7:29 pm

Re: Duplicate PDF by using Quite hot impose

Post by wwstudios »

Does it have to be duplicated with Quite Hot?

I do something very similar where I add -x50, -x3, etc. at the end of the file, and the number is updated dynamically.


To duplicate I use the Duplicate app found here:

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

The basics are:
  • add number at end of filename as a private data key in the flow input folder
  • in the 'Duplicates' field of the Duplicate properties add the private data key from earlier

It works just fine here, but if it has to go through Quite Hot Imposing then obviously it's a no-go.
Richard#250211
Newbie
Posts: 4
Joined: Tue Feb 11, 2025 1:45 pm

Re: Duplicate PDF by using Quite hot impose

Post by Richard#250211 »

So i assume there is a way to make this work? is it:

A) retrieve the info you need, than generate a XML file with the correct info (but without variables), and than use/overwrite this qi controlfile xml for the flow?

or

B) Another way to use the xml with variables so Qi can accept/ work with it?

Its all part of me learning how these things work, and hopefully opens up more ways to automise things and be more flexibel.
So no need for workarrounds (yet :) ).

Cheers Richard,
Absolute Enfocus Switch beginner!

We are using: Pitstop/Quite Hot Impose/Enfocus Switch
User avatar
JimmyHartington
Advanced member
Posts: 410
Joined: Tue Mar 22, 2011 7:38 am

Re: Duplicate PDF by using Quite hot impose

Post by JimmyHartington »

Hi Richard

I have tried to make a small flow to write the control file for Quite.
The app used is free and called Create file from template https://www.enfocus.com/en/appstore/pro ... m-template.

You can download the flow and template from this link: https://d.pr/f/NOm5an

It writes the .xml file to a fixed location and the pdf is again send to the outgoing connection. Maybe this can be integrated into your flow.
Image
User avatar
tdeschampsBluewest
Member
Posts: 114
Joined: Tue Jun 01, 2021 11:57 am

Re: Duplicate PDF by using Quite hot impose

Post by tdeschampsBluewest »

Hi Jimmy, this could work, but you'll need to handle deleting the template carefully and make sure there are no mismatches if files have the same name.

The Create Log will attach the same XML file as a dataset, and since Quite can use a dataset as a control file, it’s a pretty handy setup.
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
User avatar
JimmyHartington
Advanced member
Posts: 410
Joined: Tue Mar 22, 2011 7:38 am

Re: Duplicate PDF by using Quite hot impose

Post by JimmyHartington »

Hi Thomas

Did not know Quite could use the dataset as a control file. Then your solution is better. :-)
Post Reply