Haven't checked your demo file. But in general, if you want to figure out what URL to use, open the png in your browser and see how the browser constructs the path...
I have never tried but will insert FromURL(GetLayoutObjectAttribute( "viewer"; "source")) work?
The "result" in web viewer is something like (if you copy and paste from WV into container):
I wonder if Insert from URL would work? I just tried it with wkeja's sample and got an error.
Thanks a lot so far, your answers got me thinking.
@wim: the problem is that the barcode is generated in the webviewer. I do not have a browser with a nice url.
@bigtom: 'source' and 'content' gives a page of html / js, not the resulting png. My container represents the code.
@beverly: this my be a road to follow. Gonna try to find out more. Will be back with results (success or more questions).
theParam = encodeURIComponent(uri);
theURL = \"fmp://$/" & Get ( FileName ) & "?script=SetBarcodePNG¶m=\" + theParam;
window.location = theURL;
Hope this helps,
js_barcode.zip 86.3 K
Thank you Mike! It seems like you nailed it.
Only thing is, I feel a bit like a moron. Need a bit more help on how to pass the parameter.
I really appreciate your effort!
En een antwoord van Jan zelf!
I really hate the fact that I can't mark 2 answers as correct. I will study both files, for there is much to learn.
Thank you Mike, I most certainly will study the blogpost.
I try a similar solution to generate my barcode png from a web viewer populated by a js script.
Under OSX there is no problem to get the png inside the container but under windows it don't work.
It's like it don't execute the fmp url from window.location.
Some of you guys have experienced this issue.
I try different approach to this.
I run it from windows 10 in parallel desktop for my test.
MBS Plugin has a couple of methods, like this one:
or get a screenshot from web viewer:
of course before you use the plugin to get something from webviewer, you could use it to generate barcodes:
Hi thanks for your answer but I need a no plugin solution. So a native solution.
If anyone know a way to do this..?
I try the setClipboardData because my url param ( base 64 image ) exceed the length authorized under windows. But same issue.
Someone try the example file posted here on windows ?