Problem with pdf embeded

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Problem with pdf embeded

Postby pentamsi » Thu Dec 20, 2012 6:06 pm

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?
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with pdf embeded

Postby ROCLASI » Fri Dec 21, 2012 10:49 am

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.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5289
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Problem with pdf embeded

Postby pentamsi » Thu Dec 27, 2012 12:35 pm

I put exactly with the html tags, but nothing appear in the browser
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with pdf embeded

Postby david » Fri Dec 28, 2012 3:04 am

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.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1726
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Problem with pdf embeded

Postby pentamsi » Fri Dec 28, 2012 11:22 am

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
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Problem with pdf embeded

Postby ngervasi » Fri Dec 28, 2012 12:28 pm

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>";
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Problem with pdf embeded

Postby pentamsi » Mon Dec 31, 2012 10:08 am

Finally works, only i have to define some path in the server configuration, and put into the server folder. Thanks for all the help
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain


Return to Web Development

Who is online

Users browsing this forum: No registered users and 1 guest