printing attachments

Questions, tips and tricks and techniques for scripting in Servoy

printing attachments

Postby wes.s.grayson » Tue Mar 27, 2012 10:49 pm

I have a table called Customers. One of the fields in the Customers table is called Attachments (media field that stores PDF files). Since there may be many attachments for each Customer, I created an Attachments table and link the two tables using a customer_id field.

I would like to print out all the attachments related to a particular Customer in one combined PDF file. I've used plugins.pdf_output.combinePDFDocuments() in a previous method to accomplish something similar, but in this case I'm not sure how that would work across multiple records of another table.


Servoy 5.2.9
Smart Client
Posts: 46
Joined: Mon Jan 23, 2012 5:39 pm

Re: printing attachments

Postby Harjo » Wed Mar 28, 2012 10:01 am

HI Wes,

just loop over the foundset, and combine them one by one...

pdf_blob_column = combinePDFDocuments(new Array(pdf_blob_column, other_pdf));

or create an array in the loop first, and than do one combine:

pdf_blob_column = combinePDFDocuments(new Array(pdf_blob1, pdf_blob2, pdf_blob3));
Harjo Kompagnie
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Return to Methods

Who is online

Users browsing this forum: No registered users and 4 guests