We have reset all users FileMaker related profile fields. Please take the opportunity to update your information,  this will provide background to members whom read your posts. Click here.

Jump to content

clemhoff

Members
  • Content count

    34
  • Joined

  • Last visited

  • Days Won

    2

clemhoff last won the day on April 18 2016

clemhoff had the most liked content!

Community Reputation

2 Neutral

About clemhoff

  • Rank
    newbie
  • Birthday 07/09/1956

Profile Information

  • Gender
    Male
  • Location
    Paris-FR / Baden Württemberg-DE

Contact Methods

  • Skype
    clemhoff
  • AIM
    clemhoff9756
  1. ScriptMaster GetFileAsContainer

    Hello, Your path is kind of "Finder path"… To write the absolute/canonical path the "Unix way", just prepend the disk name by "/Volumes". /Volumes/Macintosh HD/private/var/folders/90/…etc…/file.xlsx /Volumes/Macintosh HD/Users/userAccountName/Desktop/ /Volumes/myExternalDrive/aFolder/aSubfolder/afile PS: no problem with spaces in a path, Scriptmaster's function arguments are all strings and are internally quoted at compile time.
  2. … but will fail if your target directory contains subdirectories.
  3. …just a matter of typo, your script will compile flawlessly if you write the symbol 'Try' of the try-catch statement in lowercase.
  4. iText with ScriptMaster

    hi John, ... my bad ... I just forgot to copy the "finally" clause. ... Sir, yes Sir !! …I totally agree with you as long as we're dealing with concatenating PDFs, but in current case we're splitting them and all resources are needed.
  5. iText with ScriptMaster

    Hi, here is a PDF Spliter // iText_SplitPDF ( pathToSrc ; pathToDest ) // 2012-07-05 by clem // // NOTE: To be properly numbered, the output file name must contain the format string %d // ex: pathToDest = C:/Path/To/mySplittedPortableDoc_page%d.pdf // result => C:/Path/To/mySplittedPortableDoc_page1.pdf etc… import com.itextpdf.text.Document import com.itextpdf.text.DocumentException import com.itextpdf.text.pdf.PdfCopy import com.itextpdf.text.pdf.PdfReader try{ def reader = new PdfReader(pathToSrc) def document def copy int n = reader.numberOfPages n.times{ document = new Document() copy = new PdfCopy(document, new FileOutputStream(String.format( pathToDest, it + 1))) document.open() copy.addPage copy.getImportedPage(reader, it + 1) document.close() } reader.close() return true } catch (IOException ioe){ return "ERROR: $ioe.message" } catch (DocumentException de){ return "ERROR: $de.message" } and you'll find a PDF Merger here : fmforums.com/forum/topic/73597-itext-scripts/
  6. List content of zip file

    Hej, zip_ArchiveContents ( fm_OsPathToArchive ) import java.util.zip.ZipException import java.util.zip.ZipFile try { def file = new ZipFile(fm_OsPathToArchive) fList = [] file.entries().each { it -> fList << it.name } return fList } catch (ZipException zex) { return zex.message } or import java.util.zip.ZipException import java.util.zip.ZipFile try { def file = new ZipFile(fm_OsPathToArchive) return file.entries().toList() } catch (ZipException zex) { return zex.message }
  7. iText Scripts...

    Hello, SM/Groovy is expecting a System path, not a path "à la FileMaker". Just get rid of the "file:/" prefix. Note also that in your path you can use slashes instead of backslashes. Windows knows how to interpret them since Win98.
  8. From what I see using Phil Harvey's ExifTool against the image you provided in the FM file, is that the "User comment" tag contains data of type "base64Binary". Apparently the "Metadata-Extractor" API hangs on this data format (without throwing an error). 20130104_152439_rdf.xml
  9. Hello, a quick (& dirty) example showing you how to implement the jar files and the functions. hope this helps SM_MetadataExtractor.zip
  10. Did you load the metadata-extractor-2.6.4.jar file ? to get all EXIF tags of an image contained in a container field use… // Function: metadaExtractor_getAllTags ( fieldName ) // Parameter(s) // fieldName : a container filed name import com.drew.imaging.ImageMetadataReader import com.drew.imaging.ImageProcessingException import com.drew.metadata.Directory import com.drew.metadata.Metadata import com.drew.metadata.Tag Metadata metadata = null try { bis = new BufferedInputStream(fmpro.getContainerStream( fieldName )) metadata = ImageMetadataReader.readMetadata(bis,true) } catch (ImageProcessingException ipx) { println ipx.message } catch (IOException ioe) { println ioe.message } if (metadata != null) { tagArray = [] metadata.directories.each { Directory dir -> dir.tags.each { Tag tag -> tagArray << tag } } return tagArray } PS: if the pictures are not saved 'as reference' than load the file "xmpcore.jar" too.
  11. Hello, … a way to get all the tags // Function: metadaExtractor_getAllTags ( fileIn ) // Parameter(s) // fileIn : path to picture document import com.drew.imaging.ImageMetadataReader import com.drew.imaging.ImageProcessingException import com.drew.metadata.Directory import com.drew.metadata.Metadata import com.drew.metadata.Tag Metadata metadata = null try { imgFile = new File(fileIn); metadata = ImageMetadataReader.readMetadata(imgFile); } catch (ImageProcessingException ipx) { println ipx.message } if (metadata != null) { tagArray = [] metadata.directories.each { Directory dir -> dir.tags.each { Tag tag -> tagArray << tag } } return tagArray }
  12. Move Folder

    Noël, If you want to move the folder "c:/GestALSH/Factures_PDF/E2011_2012" to the "Archives" directory of "c:/GestALSH/" then you have to set your destination path to "c:/GestALSH/Archives/E2011_2012" REM: the destination directory must not exists prior to the move process. (first check if "c:/GestALSH/Archives/E2011_2012" exists, if yes, rename your destination directory or delete the existing one.)
  13. Hi John, `PdfSmartCopy' is of course a better class to use if you concatenate PDF documents containing duplicate resources and a has very little impact on splitting PDF Documents. No ?
  14. Hi Stephen, Page extraction is very straightforward using iText's PdfCopy class. /** * iText_ExtractSinglePage ( fm_pathToSrc ; fm_pathToDest ; fm_getPageNum ) * by clem 2010-11-04 * Extrait une page d'un document PDF. * * === Parameters === * fm_pathToSrc: path to pdf input file. * fm_pathToDest: path to pdf output file. * fm_getPageNum: the page number to be extracted. **/ import com.itextpdf.text.Document import com.itextpdf.text.DocumentException import com.itextpdf.text.pdf.PdfCopy import com.itextpdf.text.pdf.PdfReader try{ def reader = new PdfReader(fm_pathToSrc) def document = new Document() def copy = new PdfCopy(document, new FileOutputStream(fm_pathToDest)) document.open() copy.addPage copy.getImportedPage(reader, fm_getPageNum.toInteger() ) document.close() return true } catch (IOException ioe){ return "ERROR: $ioe.message" } catch (DocumentException de){ return "ERROR: $de.message" }
  15. Latest Groovy

    Thank you very much !! [PS: there's a small typo in the "changelog.txt" file … Version 4.13 (1/10/2011) * Updated Groovy to version 1.8.5 ]
×