Hi all,
FileToString, work also with PDF files?
With VFP work... With lianja seem not..
thanks
Fabio
Hi all,
FileToString, work also with PDF files?
With VFP work... With lianja seem not..
thanks
Fabio
Hi Fabio,
As you stated in your ticket your requirement was to insert large strings (base64 encoded text) into the MS COM/ActiveX for XML.
I have extended the activex support in Lianja 5 to enable you to to do this by recognizing special string prefixes when setting properties in activex objects:
e.g.
// read a text file
oItem.someproperty = "text://filename.png"
// read a binary file
oItem.someproperty = "bin://filename.png"
// read a binary file and base64 encode it
oItem.someproperty = "base64://filename.png"
Last edited by barrymavin; 2019-01-15 at 18:35.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Hy Barry
How can I use it?
a = object()
a.pdf = "bin:C:\Users\Fabio\Documents\Lavoro\CEGEKA\Linak\ FattureInput\0000983_1900001.pdf" ?
thanks
Fabio
Can I use it also to upload the file into a blob/memo field of a table?
thanks
Fabio
Yes. Use objectWrite() to extract the memo/blob to a temporary file using tmpfile() first.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Hi Fabio,
read my my post again.
bin:// is the prefix not bin:
Use base64:// to insert a base64 encoded binary file.
as I stated in my post, these special prefixes are only expanded when setting com/activex properties.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Sorry Barry, I do not understand how to use it... I'm a newbie with the Activex.
I create the Acivex Object:
loXML = CREATEOBJECT('MSXML2.DomDocument')
I create the element
loEncodedPDF = loXML.createElement('EncodedPDF')
I've try with
loEncodedPDF.setAttribute('PDF', "base64://C:\Users\Fabio\Documents\Lavoro\CEGEKA\Linak\Fattu reInput\0000156_1900004.pdf")
loXML.appendChild(loEncodedPDF)
then:
strToFile(loXML.xml, "c:\temp\xml.xml")
or:
loXML.save("c:\temp\xml2.xml")
but the content of the file is:
<EncodedPDF PDF="base64://C:\Users\Fabio\Documents\Lavoro\CEGEKA\Linak\Fattu reInput\0000156_1900004.pdf"/>
thanks for all your support
Fabio
Once you have figured out what property to set on that activex you don’t use setattribute(). I never mentioned using that.
you just set the property on the activex as you normally would. I.e objname.propname
I have no idea why you are using strtofile(). The whole point I thought was to be able to store a very long base64 encoded string in the activex and that’s what I have provided for you.
le()
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Bingo!
Thanks Barry!
Bookmarks