Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

 A post on the FileMaker community posed a question about getting back to a PDF file from what had been stored in an SQL table after a sync with MirrorSync from FileMaker

original question here..https://community.filemaker.com/thread/155073

The saved data is a hex string in this case... so at the risk of giving away the keys to a magic kingdom, the answer is quite easy.

// PDFfromHex ( fm_hex )
// 16_04_02 JR
// v1.0
// converted HEX back to a pdf file
// requires Apache Commons jar

import org.apache.commons.codec.binary.Hex

try{
	decoded = Hex.decodeHex(fm_hex.toCharArray())
	PDFfile = new File('/Path/to/my/saved.pdf')
	fos = new FileOutputStream(PDFfile)
	fos.write(decoded)
	fos.close()
} catch (e) {
	return e
}
return true

 

Great contribution, as always!

This should work for any binary hex, right? Including the HEX-encoded SVG objects in FileMaker layout object clipboard data?

I assume you have a function to encode in binary hex as well? If so, would you mind posting it? If you don't have it handy, I should be able to put it together myself. My idea would be to be able to programmatically create layout objects using SVG icons, without having to use the painfully manual interface FileMaker gives us for adding new SVG icons.

I'm not quite sure yet if this can be actually useful or simply plain fun - but let me think about that.

 

  • Author

David

It does indeed work. Just change the file to save.svg
Copy a single button bar segment and look for 
BE_XPath ( $clipboardContent ; "/fmxmlsnippet/Layout/Object/ButtonBarObj/Object/ButtonObj/Stream[3]/HexData" ; "" ; True )

My other method to get the svg it is more FileMaker less Groovy... take the hex, loop over it 2 bits at a time and convert to numbers -  it will give you a series of ascii codes which then need turning into characters with Char()

And as you can tell, I have already done it, and it works... was part of my presentation at the recent Pause in Cleveland. And the automatic adding button bar objects (with some Applescript)

 

Clue to going the other way:
The opposite function is Hex.encodeHex() and is best fed with a byte array.

 

OK, great ideas - glad you already did it so I don't have to! I couldn't go to Pause unfortunately since I had something else planned at that time. Hadn't checked the schedule lately - I see now that you did something on icons - too bad I missed that! Are you coming to dotFMP this year? 

An "SVG icon injector" for FileMaker could be handy when you want to add a whole set of icons - did you already do one?

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.