Page 1 of 1

Problem with pdf embeded

PostPosted: Thu Dec 20, 2012 6:06 pm
by pentamsi
I'm trying to embed a pdf in the servoy solution webclient, but i can't view.

First of all i create a HTML_AREA field, and associate a variable called html.

Code: Select all
var html = "<iframe src='file:///Users/sergio/Downloads/User_Manual_OpenStage_20_SIP.pdf' height='1100' width='850' ></iframe>";


But when i run the solution, don't show anything inside. But if i save the web as html, and run in localy and show perfect the pdf. Any idea?

Re: Problem with pdf embeded

PostPosted: Fri Dec 21, 2012 10:49 am
by ROCLASI
You should wrap HTML inside HTML tags to be used inside HTML_AREA's.
Code: Select all
var html = "<html><iframe src='file:///Users/sergio/Downloads/User_Manual_OpenStage_20_SIP.pdf' height='1100' width='850' ></iframe></html>";


Hope this helps.

Re: Problem with pdf embeded

PostPosted: Thu Dec 27, 2012 12:35 pm
by pentamsi
I put exactly with the html tags, but nothing appear in the browser

Re: Problem with pdf embeded

PostPosted: Fri Dec 28, 2012 3:04 am
by david
When running in the context of Servoy (as in Tomcat server), you can't display files in an iframe from your computer using file:// -- it is a security issue.

Put your pdf somewhere in Servoy's webapps folder and insert an absolute or relative URL to the iframe src attribute.

Re: Problem with pdf embeded

PostPosted: Fri Dec 28, 2012 11:22 am
by pentamsi
I put in the webapps folder, but still not working, the complete route is:

var html = "<html><iframe src='file:///Applications/Servoys/Servoy_Test/application_server/server/webapps/Browser_Suite_FAQ.pdf' height='1100' width='850' ></iframe></html>";
but no way

Re: Problem with pdf embeded

PostPosted: Fri Dec 28, 2012 12:28 pm
by ngervasi
This is what David means:

Code: Select all
var html = "<html><iframe src='http://yourserver_ip:8080/Browser_Suite_FAQ.pdf' height='1100' width='850' ></iframe></html>";

Re: Problem with pdf embeded

PostPosted: Mon Dec 31, 2012 10:08 am
by pentamsi
Finally works, only i have to define some path in the server configuration, and put into the server folder. Thanks for all the help