Jump to content
Bill_misc_IT

Drag pdf into container to create multiple page pdf from existing

Recommended Posts

I have a solution to track employee expense reports which contains a container to store a pdf of related receipts.  Currently, I create a multiple page pdf of receipts in Apple Preview, then paste it into the container.  Was wondering if it was possible to create a FM script or AppleScript to drop a single, additional pdf into the container and "automatically" create multiple page pdf with the existing container contents?

Thanks in advance!

Share this post


Link to post
Share on other sites

The other alternative is to have a related receipts table and drop the new files into a portal. That way they have a unique date or description. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Dean Ingram
      I am trying to get a page count from a PDF file stored in a container field. ScribeDocLoad is successful. Next I'm attempting to use ScribeDocReadValue to get the PDFPageCount. The variable $LastPage is set to ScribeDocReadValue( "PDFPageCount" )
      This parameter, or any other of the metadata values listed in the documentation, results in an error like "Reading values is not supported for the file PDFPageCount"
      The documentation reads like this:
        Am I fundamentally misunderstanding what this is supposed to do? The PDF file has no formal "fields." Its just a scanned PDF. 
      D
    • By kims
      I am working on a script that will build a document based on a value from a drop down list.
      I have a layout that contains a Document Subtype. If a certain subtype is selected from the drop down list for this record, then I want my script to be able to pull from a specific container holding the appropriate document for that type. Then I can use Doc Append to combine the two documents. Each document would be custom then to the subtype.
      I'm pretty new at FileMaker so I'm still trying to figure a lot of things out and still trying to understand how to put things together and why it will/will not work.
      I was originally using Case but then I realized that was probably not the correct thing to do. It would either append both types of documents or one, but it wasn't always the correct one.
       
      Any guidance would be greatly appreciated.
       
      If this helps, I want something that will do this:
       
      If Subtype = a, b, or c, then append Doc 1
      If subtype = d, e, or f, then append Doc 2
      and so on...
    • By Asu
      Hello FM Mavens, 
      I am likely missing something. 
      I have a script step that calculates the dimensions of an image in a container field. There are many such fields so the script should work with any arbitrary one. 
      I get the name of the field by using script parameter Get(ActiveFieldName). 
      Let's say I have a container field "cont1". The script is triggered by entering the field.
      I am trying to calculate the height of the image by using 
      GetContainerAttribute (Get ( LayoutTableName ) & "::" & Get ( ScriptParameter ); "height" ) The results are question marks - I am not sure why. If I explicitly identify the fields then the expression works. 
      Tried the same expression (Get ( LayoutTableName ) & "::" & Get ( ScriptParameter )) in the script step "Set Field by Name" and it worked, which means that the expression correctly identifies the field the script is attached to. Then why is it not getting it the first step? What's wrong with the calculation? (FM17)
      Thanks
      Asu
       
      (I hope I posted it in the correct section)
    • By Asu
      Hello FM experts, 
      this is a concept step for a more complex script but I need a script that has 2 independent features:
      1: it selects the field it is attached to as a button
      2: it can be attached to any arbitrary field and it does the same on that field.  
      The imaginary script step would be this:
      Select field [the one I am attached to] The problem I am running into is that "go to field" can not be defined by calculation, while "go to object" gets confusing between the script and the field being grouped, as the problem detailed here [https://www.soliantconsulting.com/blog/story-about-go-to-object] seems to be a complicating factor.
       
      Thanks
      Asu
    • By Bob Minteer
      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¶" )  
×

Important Information

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