-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to add DocIDs as bookmark names? #2
Comments
Hello @ccastillo-id, I think you are really close. The issue I believe stems from this line in your version: productionSetItems = group.map{|i|i.get_production_set_items} For each item, that returns a productionSetItems = [
ProductionSetItem,
ProductionSetItem,
ProductionSetItem,
ProductionSetItem,
] I believe conceptually it's more like this: productionSetItems = [
[ProductionSetItem],
[ProductionSetItem],
[ProductionSetItem],
[ProductionSetItem],
] Or it could even possibly be more like this if some items have no production set items and others have more than 1: productionSetItems = [
[ProductionSetItem,ProductionSetItem],
[],
[ProductionSetItem],
[ProductionSetItem],
] I believe if you modify it a bit to the following you should get the result you are looking for: bookmark_titles = group.map do |item|
psis = item.getProductionSetItems
doc_nums = psis.map{|psi| psi.getDocumentNumber.toString }
next doc_nums.join(";")
end
PdfMerger.merge(final_output_file,input_files,add_bookmarks,bookmark_titles) Let me know if you have questions about that. I know I had to think about it a bit myself and even re-write it once as my first attempt didn't quite approach it right. |
The error I'm getting with changing it to this is... Export Directory: C:\Users\srvnuix\Desktop\OUTPUT at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1809) at org.jruby.RubyEnumerable.each_with_index(org/jruby/RubyEnumerable.java:1258) at RUBY.(C:\ProgramData\Nuix\Scripts\ExportFamilyPDFs_v1.14.0\ExportFamilyPDFs.nuixscript\ExportFamilyPDFs.rb:475) at RUBY.(C:\ProgramData\Nuix\Scripts\ExportFamilyPDFs_v1.14.0\ExportFamilyPDFs.nuixscript\ExportFamilyPDFs.rb:281) NEW CODE
|
I was just looking into what could cause this, but I see the issue now that you've included a screenshot. Change it from
to
The error message was happening on this line: java.io.File.new(output_file).getParentFile.mkdirs When the template was resolving, it was just a file name without a directory, which causes |
This works! Thanks! |
Glad to hear it! |
There is a Add Bookmarks checkbox that will add bookmark of the attachment's file name. is there a way to use the attachment's docid instead as well?
I tried altering the ExportFamilyPDFs.rb file from
Old
PdfMerger.merge(final_output_file,input_files,add_bookmarks,group.map{|i|i.getLocalisedName})
Attempt
productionSetItems = group.map{|i|i.get_production_set_items}
PdfMerger.merge(final_output_file,input_files,add_bookmarks,productionSetItems.map { |i| i.getDocumentNumber }.join(""))
But no avail
The text was updated successfully, but these errors were encountered: