Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
pdf_export [2024/04/04 09:05] – [Javascript] o2adminpdf_export [2024/04/04 09:07] – [Javascript] o2admin
Line 49: Line 49:
 <sxh javascript; > <sxh javascript; >
  
-// This example will extract the ID number from a filename and save the  PDF to a master folder based on the ID +// This example will extract the ID number from a filename and  
-// "Example filename "F123246 Test File.pdf"+// save the  PDF to a master folder based on the ID in the X: drive 
 +// "Example filename "Customer F123246 Test File.pdf"
  
 +// Get the current document filename
 var docName = getData('doc.filename'); var docName = getData('doc.filename');
-var matches = docName .match(/J(\F+)/);+ 
 +// Use a Regular Expression to get the ID 
 +var matches = docName.match(/F(\d+)/);
 if (matches) { if (matches) {
   setPath('X:\' + matches[1] + '\');   setPath('X:\' + matches[1] + '\');