Pagecount for OrderDocument prior to placing order

81 views
Skip to first unread message

Jon Strand

unread,
Apr 4, 2024, 11:26:24 AM4/4/24
to XMPie Interest Group
I'm using uStore Connect with a custom front end, using the WSAPI to interact with the store.  Some of our dynamic documents have a varying page count, and I need to get the page count for each OrderDocument.  

If possible, it would be nice to have that information prior to the order being placed, so that our store can record it in the line item data.  I can't find a WSAPI OrderProduct endpoint that can supply this data, so I'm wondering if that is possible.

If not, what's the best way to get page count data for each completed OrderDocument, given that we don't have a .NET-based storefront with direct access to the database?  

Thanks very much,
Jon

west-digital.fr

unread,
Apr 7, 2024, 7:45:55 AM4/7/24
to XMPie Interest Group
Due to the nature of uStore (asynchronously subcontracting compositions to uProduce, only once the order is processed in the back office, or via automated Triggers), I indeed doubt that this information can known, before the order is placed - AFAYK, even the uProduce API only gives you the number of processed records, but not necessarily the number of pages.

However, maybe you could consider this terrible workaround, if you and your application are patient enough:

Production.GetProductionOutputUrl

gives you the URL of the produced file.
Then, a PDF library may help you count the number of pages.
Terrible, as I said, because the availability of this URL may be very asynchronous (when the order is on hold in the Back Office, on purpose), but also because the produced file may be heavy.

I hope that other members will have a better idea, I'm not proud of mine.

eko...@gmail.com

unread,
Apr 9, 2024, 12:03:15 AM4/9/24
to XMPie Interest Group
I didn't know if this would help, but try this combination. 

Edit the Dynamic Product Pricing
Look for: Copies per record are based on:
Select "Value defined in uProduce job". 

This mechanism will influence the values such as price in the Product Properties page, so I'm guessing that there's a way to take advantage of the magic. 

Good luck. 

Reply all
Reply to author
Forward
0 new messages