Merge/Combine PDF Export

Hello again,

I have created a script that exports selected sheets to PDF, now I want to merge the PDF and rename it to “Project Name”+ “_EST”. I have prepared everything but have come across this error:

error

Script here:


PDF_Export_1.6 w python filter.dyn (38.3 KB)

Questions:

  1. I suspect the PassThrough node may not be giving it enough time? Is there an alternative method using nodes?

OR

  1. Is this possible within the python script (ie. combine, and save to same file location, with same file name but with suffix “_est”), where it exports the pdf in the first place. I don’t really need individual sheets, just the combined one?

I’ve tried to combine the export from the examples below from @SeanP (thank you btw), but honest I have no idea where to put the opts. commands…

Can anyone point me in the right direction?

1 Like

Hi @Dynamo_Ann,

Depending on the number of sheets to print, one PassThrough node may not be sufficient. You must then add a Thread.Pause to be sure that all the pdf files have been created.
That said, I have already added in the ExportPDF node of the Genius Loci package the ability to combine the sheets between them. (input Combine)


PDF_Export_1.6 w python filter V2.dyn (41.0 KB)

3 Likes

They need to go before the export code and just stack each one that you want to set.

opts = PDFExportOptions()
opts.Combine = True
2 Likes

I love dynamo. It allows you to customize revit functionality. At the same time, there are often add-ins which are must-haves.

I recommend downloading diroots pro sheets.

1 Like

Perfect @Alban_de_Chasteigner …Thank you very much :smiley:. I managed to work with the Genius Loci packages you used and make the combine PDF from the start, which is exactly what I wanted, a combined PDF without the other sheets, in the same folder, with the required name.

Thank you. I have di-roots everything else, but not this, didn’t even think of them… This is part 1 of a 2 part script that I wanted to create.

I spent a good amount of time trying to figure out how to batch print PDFs, which I never actually got to work. In the end, I ended up printing to a directory and re-naming the files via dynamo.

Then someone showed me diRoots Pro Sheets and I haven’t looked back.

1 Like