Jump to content

Bob Minteer

Members
  • Content Count

    36
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Bob Minteer

  • Rank
    Lurker
  • Birthday 08/26/1960

Profile Information

  • Title
    Chief Software Architect
  • Industry
    Construction
  • Gender
    Male
  • Location
    Dallas, TX
  • Interests
    Robotics, RaspPi, Arduino, Javascript and Retrocomputing with my Apple ][ computer

FileMaker Experience

  • Skill Level
    Expert
  • FM Application
    17

Platform Environment

  • OS Platform
    X-Platform
  • OS Version
    Win10 / Windows Server 2016 [rds] / OSX 10.12+

FileMaker Partner

  • Certification
    Not Certified
  • Membership
    FileMaker TechNet

Recent Profile Visitors

1,948 profile views
  1. Bob Minteer

    Which Function is Missing?

    Dennis, After the first time you run the script in question, it will register the function you are defining in line#3. Then most likely the next time you look at this script, you will see the function name, "SaveContainerAsFile" rather than <Function Missing>. --Bob
  2. Thanks John! I appreciate your patience and giving me nudges in the right direction! No wonder the BAIS was empty... I guess you have to close streams before they can flush their buffers and populate the array. You really helped me learn some excellent info today! If I see you at DevCon here in Texas this year, I'll buy ya a drink! That does exactly what I need for some stuff I am working on. regards... Bob Minteer
  3. Hi John! Thanks for giving me some direction on this. I went ahead and changed to using a ByteArrayOutputStream for PdfStamper and then, after updating the canvas (and before closing stamper), converted the byteArrayOutputStream to an input stream using byteArrayOutputStream.toByteArray(). Then after closing stamper, I try returning the fmpro.getAsContainer(byteArrayInputStream; fileName). I feel like I am closer, as I am actually returning a file to the target container (not the same as the input container). But... the file is empty. I am using itextpdf-5.5.5. As I have been kicking this mule for quite awhile, and reading quite a bit of JavaDocs at itextpdf.com , my brain is now oatmeal. I'd be grateful for an explanation as to what I am missing here. As I said, I am pretty sure I am REAL close and that it is probably a matter of me giving FileMaker back what it expects. Have an awesome day! --Bob Minteer RegisterGroovy( "stampPdf( src ; xPosition ; yPosition ; phrase )" ; "import com.itextpdf.text.Rectangle;¶ import com.itextpdf.text.Element;¶ import com.itextpdf.text.pdf.PdfReader;¶ import com.itextpdf.text.pdf.PdfStamper;¶ import com.itextpdf.text.pdf.ColumnText;¶ import com.itextpdf.text.pdf.PdfContentByte;¶ import com.itextpdf.text.Phrase;¶ import com.itextpdf.canvas.*;¶ import com.itextpdf.text.pdf.PdfWriter;¶ ¶ InputStream container¶ String fileName¶ ¶ try{¶ container = fmpro.getContainerStream(src)¶ }catch(e){¶ throw new Exception('Could not get data from container (make sure container field name is passed as text)')¶ }¶ ¶ // test if container field is empty¶ if( container == null ) {¶ throw new Exception('Container field is empty')¶ }¶ fileName = fmpro.evaluate(src)¶ ¶ reader = new PdfReader(container)¶ ¶ float xP = Float.parseFloat(xPosition)¶ float yP = Float.parseFloat(yPosition)¶ ¶ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()¶ ¶ stamper = new PdfStamper(reader, byteArrayOutputStream)¶ ¶ PdfContentByte canvas = stamper.getOverContent(1)¶ ¶ ColumnText.showTextAligned(canvas, Element.ALIGN_LEFT, new Phrase(phrase),xP,yP,0)¶ ¶ byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray())¶ ¶ stamper.close()¶ reader.close()¶ ¶ return fmpro.getAsContainer(byteArrayInputStream,fileName)" )
  4. Howdy from Texas! I am trying to change a little bit of Groovy that stamps a given phrase at a specified location on an existing PDF. The original code operates on files however I want to simply specify container fields as input and output. I did successfully change the input (src) to come FROM a container field. I can't seem to figure out how to return the resulting object to a container (dest) directly. I am passing the container parameters as: "myTable::inputContainer" and "myTable::outputContainer". Can someone please point me in the right direction here? Thanks in advance! Bob Minteer This is the code: RegisterGroovy( "stampPdf( src ; dest ; xPosition ; yPosition ; phrase )" ; "import com.itextpdf.text.Rectangle;¶ import com.itextpdf.text.Element;¶ import com.itextpdf.text.pdf.PdfReader;¶ import com.itextpdf.text.pdf.PdfStamper;¶ import com.itextpdf.text.pdf.ColumnText;¶ import com.itextpdf.text.pdf.PdfContentByte;¶ import com.itextpdf.text.Phrase;¶ import com.itextpdf.canvas.*;¶ import com.itextpdf.text.pdf.PdfWriter;¶ ¶ InputStream container¶ try{¶ container = fmpro.getContainerStream(src)¶ }catch(e){¶ throw new Exception('Could not get data from container (make sure container field name is passed as text)')¶ }¶ ¶ // test if container field is empty¶ if( container == null ) {¶ throw new Exception('Container field is empty')¶ }¶ ¶ reader = new PdfReader(container)¶ ¶ float xP = Float.parseFloat(xPosition)¶ float yP = Float.parseFloat(yPosition)¶ ¶ stamper = new PdfStamper(reader, new FileOutputStream(dest), PdfWriter.VERSION_1_7)¶ ¶ PdfContentByte canvas = stamper.getOverContent(1);¶ ¶ ColumnText.showTextAligned(canvas, Element.ALIGN_LEFT, new Phrase(phrase),xP,yP,0)¶ ¶ return stamper¶" )
  5. Bob Minteer

    plugin generated -> install in FMS

    Yes indeed. I have a Scriptmaster based plugin that I created to be used by server-side scripts (under Windows FMS14). Works great! regards... Bob
  6. Bob Minteer

    MD5 from Web Viewer to field

    Whoa! You know... I thought that I had investigated ALL of the new features in Filemaker 13... I did NOT see GetContainerAttribute() !! Thanks for pointing that one out! regards... Bob
  7. Bob Minteer

    Reading Bar Codes with zxing Java Library

    Many thanks John! That has put me back on track. I am attempting to read barcodes from PDF's. While working through this, I kept testing and tweaking... to no avail. Then it occured to me, "Doh! I have to convert the PDF's to images like tiff before zxing will do the decoding". Your code works great on images with EAN128, Code39 and QR. Now I am on to working out conversion via the Apache PDFBox library so that I am passing an image to zxing library. regards... Bob Minteer
  8. Bob Minteer

    Integrating FMEasySync

    Hi Lee! To be truthful, I commented on Matt's post to get it "un-pinned" from the "unreplied topics" list. <sheepish grin> Have a great evening!
  9. Has anyone had success using the zxing library to read/decode bar codes with ScriptMaster ? I generate them just fine using the Barcode4J library. I think I am having dependency issues (take a pill...) and not much forward momentum getting it to work. Examples, suggestions or commiseration are greatly accepted. regards... Bob Minteer
  10. Bob Minteer

    Integrating FMEasySync

    cool
  11. Bob Minteer

    keep format input

    I am sorry, I'd love to answer your question, but it does not appear to make sense to me. Do you care to elaborate ? --Bob
  12. Bob Minteer

    MD5 from Web Viewer to field

    I just realized that you said that you are using Filemaker 12. If it were 13, you could use a Javascript call back to Filemaker via fmp:// protocol and pass the MD5 as a parameter to a FM13 script. But, since you are using Filemaker 12, I would merely use the FREE BaseElements plugin which has MD5 and SHA256 functions to do the job (...and I would probably opt for this method under 13 as well... because it's dead simple.). The script step would simply look like: Set Field [md5::field_md5[]; BE_MessageDigest ( md5::field; BE_MessageDigestType_MD5 )] This IMHO would simplify things quite a bit. regards... Bob Minteer
  13. Bob Minteer

    Downloads in CWP

    Hi Dave! I have a web portal that I use to serve up "job site photos" to my vendor. My Filemaker Server is completely inside my firewall and the web application server "straddles" the firewall. I use SuperContainer internally for all of my images. As such, it works pretty easy to pull the SuperContainer managed images from the Filemaker Server to my (linux) web server. I am doing something very similar to the following: // Make sure that JPEGs have enough elbow room in memory when creating thumbnails ini_set("memory_limit","50M"); require_once("supercontainer.php"); $IMAGECACHEDIR = "tempdl"; // This is top level where we will download supercontainer files $SC_BASE_URL = 'http://myserveraddress.com/SuperContainer/Files'; // Base URL // Full path to the images folder $TEMPFILES = "/var/www/books/" . $IMAGECACHEDIR . "/"; $sc = new SuperContainer($SC_BASE_URL); // Create a new SuperContainer object $targetfile = "Books" . "/" . $BookRecord['bookID'][0]; // Ask for the file's info. $targetinfo = $sc->getInfo($targetfile); // Create an OS friendly file name of of it $fileName = strtolower(str_replace(" ","",str_replace("r","",$targetinfo['name']))); // I grab some of the file info which I use for display and such $fileSize = $targetinfo['size']; $uploadDate = $targetinfo['date']; $at_container = $sc->download($targetfile,$TEMPFILES . $fileName); ?>
  14. Bob Minteer

    CWP XML Authentication

    I almost forgot to mention that you may find SeedCode's GoZync of interest. http://www.seedcode.com/filemaker-sync-gozync/ It is a well done, well documented means of creating and synchronizing tables (or subsets thereof) intelligently between mobile devices and a Filemaker Server. There are cost per seat amounts to consider, but it works well for users who may venture in and out of cellular data coverage areas.
  15. Bob Minteer

    CWP XML Authentication

    Ok, so you've gotten the hard part out of the way. You will just slap yourself in the head and say, "Aw man... I should've thought of THAT". Let's say I add user permissions to my database (directly or via Active Directory or Open Directory). I will create a privilege set (let's call it 'webprivs') specifically for accessing CWP stuff, making certain that that includes XML extended privs (fmxml). Then I will create a Filemaker user account that uses the new 'webprivs' priviliege set. You may use a locally create user/password or if you are externally authenticating to the Active Directory or Open Directory, this will be the "Security Group" name (for AD... I've never used OD). If the user account (or externally authenticated group name) is named "webacct", then my URI will look something like: http://webacct:webpass@myfmserver.com/fmi/xml/FMPXMLRESULT.xml?-db=mydatabase&-lay=mySpecialLayout&personID.op=eq&personID=2690 or http://webacct:webpass@192.168.123.101/fmi/xml/FMPXMLRESULT.xml?-db=products&-lay=sales&-findall Does that make sense ? regards... Bob Minteer
×

Important Information

By using this site, you agree to our Terms of Use.