www.webdeveloper.com
Results 1 to 11 of 11

Thread: Embedding an HTML object in a page

  1. #1
    Join Date
    Aug 2011
    Location
    near Sacramento, CA
    Posts
    50

    Embedding an HTML object in a page

    I need to embed a miniature image of an HTML page in another HTML page. I found the following technique at http://www.web-source.net/embedding_web_pages.htm which does part of what I need:

    Code:
    <object data='the_url' width="600" height="400">
       <embed src='the_url' width="600" height="400"> </embed>
       Error: Embedded data could not be displayed.
    </object>
    There's just one thing wrong with this: the embedded image is displayed at full size. I need to reduce it so that the entire image (a landscape mode U.S. letter-size page) fits in an area a few hundred pixels wide and high.

    I know that the <object> tag can be used with the <param> tag to set parameters for the code that displays the object, but I can't find a description of the parameters (if any!) that apply to an HTML object. Does anyone know where to look?

  2. #2
    Join Date
    Aug 2011
    Location
    near Sacramento, CA
    Posts
    50
    I said "Just one thing wrong with this..."

    Actually, two things. The other is that in Firefox (but not in IE) I get a notice at the top of the page that says, "Additional plugins are required to display all the media on this page."

    When I click the "Install Missing Plugins" button, though, I get the message "No suitable plugins were found."

    I don't know how Firefox decides that it needs a missing plugin, what criteria it uses to look for one, or where it looks. Finding the missing plugin really won't solve the problem, because this code will be used by inexperienced people who may have trouble installing a plugin even if I can give them simple instructions.

    What I really need is a way to eliminate the message without installing a plugin. I don't know if that's even possible, but it ought to be; the browser displays the embedded page correctly (except for the zoom) after complaining that it can't.

  3. #3
    Join Date
    Mar 2011
    Location
    Ponca City, OK
    Posts
    42
    I'm not sure that it is possible to scale down a live page with HTML, perhaps you should take a screen shot of the site you want to show and scale that down.

  4. #4
    Join Date
    Aug 2011
    Location
    near Sacramento, CA
    Posts
    50
    Not practical in this case, because the details will be different for every user (and usually for every visit by every user).

    I originally planned to display a PDF, which does let me zoom, but I ran into plug-in issues when I did that. Even if I could solve the issues users would have to deal with them, which makes that approach a non-starter.

    I may have to simply eliminate this feature.

  5. #5
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    Is the inserted page one of your own pages? or someone elses?
    If details are different for every viewer, are there multiple pages that will be inserted? one at a time but different pages for different viewers?
    Why choose the <object> and not just use an iframe?... no error message about pluggin, etc?
    EfV

  6. #6
    Join Date
    Aug 2011
    Location
    near Sacramento, CA
    Posts
    50
    Is the inserted page one of your own pages? or someone elses?
    Mine (in the sense that I generate it).

    If details are different for every viewer, are there multiple pages that will be inserted? one at a time but different pages for different viewers?
    The insert is a single letter size page in landscape mode.

    Why choose the <object> and not just use an iframe?... no error message about pluggin, etc?
    The display area is a rectangle within another page, and as far as I know, frames can't be defined that way. Also, I planned to display the insert as a PDF until I ran into plug-in problems, which I believe would have required <object> tags in any case.

  7. #7
    Join Date
    Mar 2011
    Location
    Ponca City, OK
    Posts
    42
    If the page you want to show is being generated by yourself, then why can't you capture it as an image? You have complete control over the page. I'm confused as to what the functionality of this small display is for, but I'm sure there is a better way that will meet your needs.

    Please give me some more information.

    Thanks.

  8. #8
    Join Date
    Aug 2011
    Location
    near Sacramento, CA
    Posts
    50
    This is a little frustrating, because I don't understand what information you want, or why. I don't think it's appropriate to discuss the specific details of my client's application in a public space, and I've already described the technical requirements in considerable detail. What do you need to know?

    Reading over your earlier posts, I got the impression that you're thinking of this as a situation where I can create an image and upload it to the server. If so, that may explain the misunderstanding. The document is created in the course of a transaction, and needs to be displayed at the end of the transaction, seconds or minutes later.

    I considered converting the document to a JPG, which would make the problem easy to solve, but the conversion turned into a bigger problem than the problem I was trying to solve. I found an application called ImageMagick that said it would convert HTML to JPG, but it would have to be installed on the server, and it required GhostScript and something else, each of which would have to be installed, and GhostScript required a fourth thing... all of this on a shared server that doesn't give me shell access. Switching to a dedicated server would be 'way out of proportion to the size of the problem I'm trying to solve. I can't responsibly suggest that to my client.

    If you know of a way to convert HTML to JPG without leaving PHP, that would be an ideal solution.
    Last edited by jhsachs; 08-07-2011 at 08:36 PM.

  9. #9
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    If you generate the page yourself, why not design that insert page specifically to fit the space available? not sure what you mean by iframes not being able to be configured like you want...
    So if you have a 600 x 400 space that you want filled, create/style the insert page to specifically fit into that space, just like you would if you where targeting the small screen of a mobile device.
    Here's an example of what I mean:
    http://www.hiesequim.com/
    scroll down the page to where you see the ExploreOlympics pluggin. It's a PHP page (eo_feed.php) that is displayed in an iframe....
    Code:
    <iframe src="http://www.exploreolympics.com/eo_feed.php" width="300" height="585" frameborder="0" style="border:none;" ></iframe>
    But I styled eo_feed.php... including the Web site top banner, to fit into just the space available, 300 x 585 (down from 1000 wide).
    You could style any page to fit in any size container that you wanted. Of course you might not use the exact same version of the page or CSS that you would for a larger screen, but you could get any page to fit into any space you want.
    Best of luck!
    Eye for Video
    www.cidigitalmedia.com

  10. #10
    Join Date
    Mar 2011
    Location
    Ponca City, OK
    Posts
    42
    I'm just trying to figure out the reason you have to show a live page in a "thumbnail" in an iframe. If I knew what you were trying to do like, show a layout preview, I could come up with a solution. I'm not asking you to tell me what all the project is about or who its for, all I'm curious about as a fellow web developer is the purpose of this scaled down HTML page. I'm just trying to help you out with your problem.

  11. #11
    Join Date
    Aug 2011
    Location
    near Sacramento, CA
    Posts
    50
    mikeroq: It is essentially a thumbnail; something that shows the user, "when you download your document, or get it by email, it will look like this." We also give the user the option to display the full-size document on a new page, but that approach has created a great deal of confusion for unsophisticated users in the past, and I was hoping to reduce the need, or temptation, for them to use it. That may be more trouble than it's worth, though.

    eye for video: I stand corrected. I was thinking of the <frame> tag; I haven't used <iframe>, and it didn't register in my mind as something different.

    Once I define the iframe, though, I am still faced with the problem of how to shrink the document to fit the frame. It seems to me I might be able to do that with <object>, although I haven't figured out how. I'm quite sure I can't do it with a frame.

    I've considered creating a second, reduced version of the document that fits in the frame or whatever, but that's over the line between "reasonable solution" and "not worth it." (Actually I would have dropped the thumbnail idea before this, but I'm hoping to learn how to do something new and useful.)
    Last edited by jhsachs; 08-08-2011 at 01:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles