Converting from frame-based using PHP - require_once

I am converting an old site, previously using a frameset to
combine a menu and a page of images that change using a timeline.
Rather than combine the menu and page into one page (the menu
would need to be altered in over 50 files when new pages are
added), I am using require_once for the menu.
The problem is that the only way to display BOTH the menu
(from PHP) and the rest of the page in Dreamweaver is to put the
PHP require_once script at the end of the source code. BUT this
seems to stop the timeline working.
The only way to make the timeline work is to put the PHP at
the beginning of the source code, but this then only shows the PHP
part of the page and NOT the rest of the page, which ideally I need
to edit...
Any ideas how I can get the PHP to work AND display in
Dreamweaver design view AND the timeline to play properly?
Thanks

> I have found I have had to get rid of the <body>
tags in both documents
> for it
> to display - I have then added a blank image and set
this to start the
> timeline
> when it loads.
Something is wrong if you have discovered this. The parent
page must have
the body tags. Then you can use either an onload attribute in
the body tag
or a javascript call at the bottom of the page (right before
</body>) to
trigger the timeline.
BUT - why are you using a timeline at all? If it's only to
support the
menu, there are MUCH better (and much less prehistoric) ways
to do this.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"colinwalton" <[email protected]> wrote in
message
news:g4a3pk$pu0$[email protected]..
> Great thanks - this helps a lot.
>
> I have found I have had to get rid of the <body>
tags in both documents
> for it
> to display - I have then added a blank image and set
this to start the
> timeline
> when it loads.
>
> Its a bit of a clunky way of doing it but seems to work.
>
> It is now set up so the main file - the one with the
timeline, contains
> the
> DOCTYPE meta tags etc, the includes file is then
referred to at the END of
> this
> document...
>
> The includes file has the SCRIPT as well as the HTML to
make the menu
> roll-overs work.
>
> Is this the best way of setting this up? I have fifty of
them to do, so
> don't
> want to be doing it incorrectly 50 times over!
>
> Ideally I would like to have <body> </body>
tags so I can set attributes
> to
> it - what is the correct way and place to do this, so
the timeline works
> as
> well? or should I just avoid using <body> tags at
all?
>
> Thanks
>

Similar Messages

  • How to convert from image based pdf to text based pdf

    I have Adobe 9 Pro. How to convert from image based pdf to text based pdf? For example, if someone emails a scanned pdf to me, how do I convert that document into a text based pdf?

    To perform OCR, open the document and select: Document > OCR Text Recognition > Recognize Text Using OCR
    More information on the various options is in the Acrobat help doc.

  • Populate Livecycle PDF from mySQL database using PHP

    I'm trying to set up a database of loan agreements, where users will submit a form through Acrobat and their information will be stored in a mySQL database. Later, they can go back and download the PDF, which will be repopulated with their data in the mySQL db.
    I made the form in Livecycle Designer and submit the information through HTTP POST. I can easily get the information from the form into the database...my only problem is getting that information back out into the PDF.
    What would allow me to write back to the PDF, preferably using PHP? What kind of syntax would that require?
    Thanks!

    I have a vital form that clients fill out, which is passed to many people in the company along the workflow. The form is a Planner and we have in the following PDF, Word Doc..
    Well before, the Planner.pdf was originally created in Word, since most people have access to Word.. but evolved to a PDF form created from the Word Doc via Adobe LiveCycle Designer 8.0 w/ User Rights enabled so that the form could be filled out and saved using Adobe Reader.. which was a step better than Word.. being that it is free. But this needed to be easier and more to the point b/c some clients don't particularly like installing the latest version of Reader, even if you provide them the link. Nor do they like saving the form, filling the form, and attaching the form to send back.
    My goal is to have the client fill an HTML version of the form, submit and be done with it, but everyone in the workflow be able to easily receive the filled Planner as a PDF form.
    So some months ago I ran into this post Chris Trip, "Populate Livecycle PDF from mySQL database using PHP" #8, 22 Sep 2007 4:37 pm
    which uses the command line Win32 pdftk.exe to merge an FDF file into an existing PDF on the remote server, and serve this to whoever.
    My problem was with shared hosting and having the ability to use the Win32 pdftk.exe along with PHP which is predominantly used on Linux boxes. And we used a Linux box.
    so i created the following unorthodox method, which a client fills the HTML version of the Planner, all field values are INSERTED into a table in MySQL DB, I and all filled planners that have been filled by clients to date can be viewed from a repository page where an XML file is served up of the corresponding client, but someone would have to have Acrobat Professional, to import the form data from the XML file into a blank form.. altoughh this is simple for me.. I have the PHP file already created so that when a Planner is filled and client submits. >> the an email is sent to me with a table row from the repository of the client name, #, email, and a link to d-load the XML file,
    But I also have the PHP files created so that the Planner can be sent to by email to various people in the workflow with certain fileds ommitted they they do not need to see, but instead of the XML file beiong served up i need the filled PDF Planner to be served.
    I can do this locally with ease on a testing server, but I am currently trying to use another host that uses cross-platform compatibility so i can use PHP and the pdftk.exe to achieve this, as that is why I am having to serve up an XML file b/c we use a Linux server for our website, and cant execute the exe.
    Now that I am testing the other server (cross-platform host), just to use them to do the PDF handling (and it's only $5 per month) I am having problems with getting READ, WRITE, EXECUTE permissions..
    Si guess a good question to ask is can PHP do the same procedure as the pdftk.exe, and i can eleminate it.
    or how in the heck can i get this data from the DB into a blank PDF form, like i have described??
    here are some link to reference
    Populating a LiveCycle PDF with PHP and MySQL
    http://www.andrewheiss.com/Tutorials?page=LiveCycle_PDFs_and_MySQL
    HTML form that passed data into a PDF
    http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.htm l
    and an example
    http://accesspdf.com/html_pdf_form/

  • Datagrid populated from mysql dbase using php

    There are three methods: loadvars, xml and flash remoting.
    I have a great tutorial from Lee Brimlow but he only passes one column into a listbox.
    I want various columns passed into a datagrid.
    I'm not too sure how to amend the php code
    <?PHP
    $link = mysql_connect("Localhost","user","password");
    mysql_select_db("cambridgekidsdb");
    $query = 'SELECT * FROM trivia_user';
    $results = mysql_query($query);
    echo "<?xml version=\"1.0\"?>\n";
    echo "<triviauser>\n";
    while($line = mysql_fetch_assoc($results)) {
    echo "<item>" . $line["user_name"] . "</item>\n";
    echo "</triviauser>\n";
    mysql_close($link);
    ?>
    How do I "echo" out the other columns.
    The flash AS3 code is:
    var theXML:XML = new XML();
    theXML.ignoreWhite = true;
    theXML.onLoad = function() {
    var nodes = this.firstChild.childNodes;
    for(i=0;i<nodes.length;i++) {
    theGrid.addItem(nodes[i].firstChild.nodeValue,i);
    theXML.load("http://www.cambridgekids.es/trivia_user.php");
    I'm almost there and this will be fundamental to my website as I can create important stats on hundreds of children.
    Thank you in advance.

    Hi.
    I have a lot better understanding of everything from so many tutorials and googling so that's a bonus.
    I now have AS3 and using URLVariables
    The php code is perfect because on linking to the php file it echos (prints) the correct name = value sintax/format
    However, flash emits an error message:
    Error: Error #2101:
    The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs
    at Error$/throwError()
    at flash.net::URLVariables/decode()
    at flash.net::URLVariables()
    at flash.net::URLLoader/onComplete()
    <?php
    //$username = $_POST['username']; //the second user name was a variable POSTED from flash and assigned here to $username
    $username = 'DAVIDSAUGAR';
    mysql_connect("localhost","user","password") or die (mysql_error());
    mysql_select_db("cambridgekidsdb") or die ("no database");
    $sql = mysql_query("SELECT user_name, user_id FROM trivia_user WHERE user_name='$username' LIMIT 1");
    while($row = mysql_fetch_array($sql)) {
        $theName =  $row['user_name'];
    echo "usernameToFlash=$theName";
    mysql_close();                   
    ?>
    FLASHCODE
    stop();
    var variables:URLVariables = new URLVariables();
    var varSend:URLRequest = new URLRequest("www.cambridgekids.es/trivia_user.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    variables.username = "DAVIDSAUGAR";
    varLoader.load(varSend);
    function completeHandler(event:Event):void{
         var user = event.target.data.usernameToFlash;
    graphTitle_txt.text = user;
    You are probably thinking WHY am I passing in a username to get the same username out - well I'm only testing at the moment.

  • Converting from PC-based PDA to Mac-based PDA

    I have been using a Sony Clie for about 4 years and during that time I have abandoned the PC world and converted everything to Mac....execpt my PDA! Can anyone describe the process of transferring all of my data and software from the PC PDA world to the Mac PDA world? I recognize that I will need Mac versions of some software but I have a huge lists of contacts I am most concerned about this as well as other files. I am also in the market for a new PDA and am wondering what handhelds others have found work well with a Mac. I have considered the Palm Tungsten. Many thanks to those that reply.

    Off the top of my head there are two options, first is the inbuilt "mail" with Mac OS X which is good, or if you have MS Office 2004 for the Mac, you can use entourage, which is MS's current offering of mail for the mac, however the current version is a fair distance away from outlook, although this will change with office 2008 due out in the first quarter of next year.
    The other option if you are collecting pop3 email which most people do at home is have a look at Mozilla thunderbird form the makers of Firefox web browser, very good email client and free.
    sorry I can't give more information, have not lonf had my MacBook Pro, and the last Mac I had was a good few years ago
    Hope this helps
    all the best
    Dave

  • Want to see on screen data from oracle database using php

    I am struggling on the problem of echoing data from Oracle database (9i) to the screen for viewing. For ex. the data has records from various cities. when a particular city is inputted as prompt, all the records for the that city from the table should appear through PHP. Can someone help me?

    Thank you very much for giving the link. I tried and it is working. Only, I am still struggling with trying to get many fields from the database on the screen for viewing. Ex. a prompt to ask which country and which month. If I give India and December it must give all the data pertaining to India for December. This AJAX was very useful, as it gave lot of tips, but my basic query to see the data thru PHP from my database is still unsolved. Any help??
    Jacob
    Thanks once again for the help.

  • How to handle tab stops when converting from Frame to RoboHelp

    I have several examples of programming code that have tabulated indentations in the FrameMaker documents I have inherited.
    But when I convert to RoboHelp, the tab stop is only recognized by a single space.
    What would be the best way to deal with this? There are so many examples, and sometimes there can be multiple levels.
    Remember, all these manuals have already been written in Framemaker, so the less I have to manipulate these samples, the better!
    Thanks 

    Did anyone from Adobe get back to you on this bug?
    Now that TCS3 is out there, did they fix it?
    Do you know how we can find out the status of this and other issues with Adobe?
    We have been very disappointed with TCS2 and if Adobe hasn't fixed known issues from that version, I wonder if they will in TCS3...or ever? Flare is looking pretty good at this point.
    Missy

  • Converting from ie and using mac office 2004

    We just upgraded to Mac office 2004 and are trying to figure out how we can insert url's into entourage messages. In the past, we used the Insert command which provided a list from IE's favorites...now that seems to be either impossible or hard to find.
    Does anyone have any ideas??? It would seem that with all the interoperability objectives and MSFT's advance notice of discontinuing IE .... there should be something out there somewhere....
    IMac ppc4 800mhz   Mac OS X (10.3.9)  

    That is possible...but the mac office used to have a function that allowed one to (using the insert command) insert a url link stored in IE as a favorite.
    Opening two programs, as you suggest, is somewhat of a step backward and requires the user to open their browser (if not open), find the url in the bookmarks, copy it and then paste it in the email/document.
    If you have any ideas - I'd be interested in hearing about them.

  • Hyperlinks lost when converting from Word 03 using Acrobat PDFMaker 10.0

    This hasn't been an issue before (using the same version of both softwares). I checked in Conversion Settings, and both Add Links and Create Bookmarks are checked. Help! Thanks!

    Try updating to 10.1.3.

  • PHP require_once code is not working any more

    Before updating to Dreamweaver CC14 (from CS5.5), my php "require_once" files were working fine. When I imported the "ste" file into CC2014, and upload the files as usual, I get this error:
    Warning: require_once(/var/chroot/home/content/d/m/w/dmwebcreation/html/includes/_footer.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/d/m/w/dmwebcreation/html/dmweb-2/index.php on line 15
    Fatal error: require_once() [function.require]: Failed opening required '/var/chroot/home/content/d/m/w/dmwebcreation/html/includes/_footer.php' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/d/m/w/dmwebcreation/html/dmweb-2/index.php on line 15
    This is the php code that I am using in order to have these files added to any page and any directory.
    <?php
       $path = $_SERVER['DOCUMENT_ROOT'];
       $path .= "/includes/_footer.php";
       require_once($path);
    ?>
    This is the location for my test file:    http://dm-webcreation.com/dmweb-2/index.php
    I have Dreamweaver CC 2014 set up as "Links Relative to SITE ROOT" ... so that these files brought in from any files in any direction.
    Has something changed in CC 2014?

    I am using "Links Relative to Site Root" because of my "includes" files which I need to have relative to the site root so that it will not matter where I place the main files, I can still use the "includes" files as "templates" (for my menu, header, footer, copyright line, etc.) inside any file in any directory. The idea for using this "links relative to site root" coding came from: http://css-tricks.com/php-include-from-root/
    You will see that it is not just the php include file that is giving me problem, but even the image I placed on the page will not show up online.
    Interestingly, this webpage shows up without problem on my localhost testing server, but (as of this past week) it does not show up properly online.
    I have a virtual host set up as a localhost testing server in the C:\xampp\apache\conf\extra\httpd-vhosts.conf  file like this:
    The setup uses http://site1 as my local host like this:
         <VirtualHost *:80>
           DocumentRoot "c:/users/...../documents/@Websites/dm-webcreation"
           ServerName site1
         </VirtualHost>
    I manage several websites in the same hosting online, so I use "site1" as one website, and "site2" as another website for the local host testing server. In my remote hosting, I host all each website in a different directory of my main hosting (dm-webcreation.com) and point each website's domain name to that directory.
    And this works correctly on my localhost for the website. Both the image file and the php include file show up perfectly.
    My remote server is set up like this Dreamweaver CC2014:
         FTP Address: dm-webcreation.com
          Root Directory:  /dmweb-2/
         Web URL: www.dm-webcreation.com
    My testing server is set up like this in Dreamweaver CC2014 (this matches my VirtualHost set up):
         Server Folder: C:\Users\.....\documents\@Websites\dm-webcreation\
         Web URL: http://site1/
    I do receive this Dreamweaver error when saving the testing server set up:
    The URL prefex "/" of your testing server does not match the URL prefix "/dmweb-2/" of your site. Since you are using site relative links it is possible that your links will display  incorrectly at runtime...
    The strange thing is that I have three websites that were all set up the same way and they all worked fine until I imported them into this new version of Dreamweaver CC2014.
    That's why I am so puzzled. I have created this simple page (www.z.dm-webcreation.com/dmweb-2) just to try to discover what has changed.
    The other websites have the exact same "link relative to site root" in them, but they work without any problem. (www.airpyramid.com , www.leofenton.com ,  www.dev.casacristianavida.com ).
    Either something in my hosting has changed or Dreamweaver's Site Manager works differently...
    I AM REALLY PUZZLED!!

  • How can i get a component from frame?

    how can i get a JTextField component from the frame?
    in my program i use button and text fields, when button is pressed the action listener performs the needed actions: it must take the values in the text fields and do something with them,
    for example i have a button - view:
    look at the comments
    public class _ActionListener_search implements ActionListener {
         private JFrame frame;
         private database dtbs;
         public _ActionListener_search(JFrame frame, database dtbs) {
              this.frame = frame;
              this.dtbs = dtbs;
         @Override
         public void actionPerformed(ActionEvent arg0) {
              if (arg0.getActionCommand().equals("view_person"))
                                            //HERE i want to get values from text fields!
                                            //i need to get JTextField component from frame and use it
    view.addActionListener(new _ActionListener_search(frame, dtbs));how can i do it?
    is this a correct way?

    Encephalopathic wrote:
    If you know that you're going to need the data held in them why not give the class that holds them a public method that returns the Strings that they hold.
    public String getTextFieldXyzText()
    return textFieldXyz.getText();
    }Then if your actionlistener has a reference to this class's object, it can simply call the above method.That's what I was thinking. The view has a method getXyzText() and the listener (or some larger, enclosing controller) knows the view.
    What I would get away from is a single, switch-board listener hooked to a 100 unrelated buttons.

  • Parsing pdf form using PHP or JavaScript

    Hello! How can I parse Pdf file with form to get fields position and page # of it?
    For example, there are some pdf with structure like this:
    <</AcroForm 23 0 R/Metadata 2 0 R/Outlines 6 0 R/Pages 9 0 R/Type/Catalog>>
    endobj
    19 0 obj
    <</DA(/ZaDb 0 Tf 0 g)/FT/Btn/Ff 49152/Kids[18 0 R 20 0 R]/T(Language)>>
    endobj
    23 0 obj
    <</DA(/Helv 0 Tf 0 g )/DR<</Encoding<</PDFDocEncoding 26 0 R>>/Font<</Helv 22 0 R/ZaDb 35 0 R>>/XObject<</DSz 51 0 R>>>>/Fields[19 0 R 21 0 R 39 0 R 16 0 R 17 0 R 46 0 R 47 0 R 48 0 R]/SigFlags 1>>
    endobj
    25 0 obj
    <</BBox[0.0 0.0 72.0 20.0]/FormType 1/Length 102/Matrix[1.0 0.0 0.0 1.0 0.0 0.0]/Resources<</Font<</Helv 22 0 R>>/ProcSet[/PDF/Text]>>/Subtype/Form/Type/XObject>>stream
    1 g
    0 0 72 20 re
    f
    /Tx BMC
    q
    2 1 68 18 re
    How can I get field position from this code using PHP or JavaScript?
    Thanks.

    I solve my problem using Itext Pdf Library for Java. See here: http://stackoverflow.com/questions/19066141/itext-get-field-coordinate s-from-existing-pdf

  • Openoffice api converted pdf not loading using acrobat viewer

    While i used AcrobatFaxProducer of RFAX component java api which in turn uses Acrobat.jar and MRJToolkit to support pdf documents to fax.
    but you know while I tried to fax a pdf document which is being converted from word file using openoffice api, I got an error as follows:--
    Kindly requested to revert back with a solution for this.
    com.adobe.acrobat.sidecar.FontException:Corrupted or unrecognized font ().
    at com.adobe.acrobat.sidecar.AWTOutlines.doAWTOutlines(AWTOutlines.java:
    at com.adobe.acrobat.sidecar.AWTOutlines.<init>(AWTOutlines.java:351)
    at com.adobe.acrobat.pdf.PDFFont.<init>(PDFFont.java:1490)
    at com.adobe.acrobat.pdf.VPDFFontInstance.computePDFFont(VPDFFont.java:3
    at com.adobe.acrobat.pdf.VPDFFont.computeObject(VPDFFont.java:146)
    at com.adobe.pe.notify.VValuePurgeable.compute(VValuePurgeable.java:76)
    at com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
    at com.adobe.pe.notify.VValuePurgeable.objectValue(VValuePurgeable.java:
    at com.adobe.acrobat.pdf.VPDFFont.pdfFontValue(VPDFFont.java:128)
    at com.adobe.acrobat.pdf.VPDFFontByRef.computePDFFont(VPDFFont.java:260)
    at com.adobe.acrobat.pdf.VPDFFont.computeObject(VPDFFont.java:146)
    at com.adobe.pe.notify.VValuePurgeable.compute(VValuePurgeable.java:76)
    at com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
    at com.adobe.pe.notify.VValuePurgeable.objectValue(VValuePurgeable.java:
    at com.adobe.acrobat.pdf.VPDFFont.pdfFontValue(VPDFFont.java:128)
    at com.adobe.acrobat.pdf.VPDFFontByName.computePDFFont(VPDFFont.java:215
    at com.adobe.acrobat.pdf.VPDFFont.computeObject(VPDFFont.java:146)
    at com.adobe.pe.notify.VValuePurgeable.compute(VValuePurgeable.java:76)
    at com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
    at com.adobe.pe.notify.VValuePurgeable.objectValue(VValuePurgeable.java:
    at com.adobe.acrobat.pdf.VPDFFont.pdfFontValue(VPDFFont.java:128)
    at com.adobe.acrobat.pdf.Funct_cTJ.computeOffsetsAndString(TextExecuter.
    9)
    at com.adobe.acrobat.pdf.Funct_cTJ.setUp(TextExecuter.java:973)
    at com.adobe.acrobat.page.ContentParser.executeLiteral(ContentParser.jav
    at com.adobe.acrobat.page.ContentParser.churn(ContentParser.java:101)
    at com.adobe.acrobat.page.ContentArray.doSomeComputing(ContentArray.java
    at com.adobe.acrobat.page.ContentArray.thereIsContentAt(ContentArray.jav
    at com.adobe.acrobat.page.ContentArray.draw(ContentArray.java:239)
    at com.adobe.acrobat.page.ContentArray$1.draw(ContentArray.java:63)
    at com.adobe.acrobat.PDFDocument.drawPage(PDFDocument.java:191)
    at com.java4less.rfax.AcrobatFaxProducer.createImage(AcrobatFaxProducer.
    4)
    at com.java4less.rfax.AcrobatFaxProducer.getFaxPage(AcrobatFaxProducer.j
    at com.java4less.rfax.FaxModem.createFaxFiles(FaxModem.java:422)
    at com.java4less.rfax.FaxModem.open(FaxModem.java:489)
    at AcrobatFax.main(AcrobatFax.java:63)

    Hi anaghad,
    You can deduce the orientation. Actually the value of the ASFixedRect are [ lower-left x, lower-left y, upper-right x, upper-right y ]. To have the correct value use the ASFixedToInt32 and you will be able to find the orientation of the Media with the length and heigth.
    Use the rotation to change the orientation.
    E.g. MediaBox [0 0 100 400] is portrait. If you have a rotation of 90° in addition it's landscape.
    Regards,
    Joe

  • Converting Frames Created Using Frontpage?

    Hello!
    I recently moved several pages (copied from one root folder
    to another) from a now defunct site to the new site I am building.
    These pages were created using frames via Frontpage. Is there a way
    within Dreamweaver to 'convert' these pages to something not
    frame-based?
    Thanks!

    Not without doing it manually. You'd be looking at less
    hassle and work
    just to build the page, and copy content from the desired
    frame page.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "BigMusicGeek" <[email protected]> wrote in
    message
    news:fq7srd$jhq$[email protected]..
    > Hello!
    >
    > I recently moved several pages (copied from one root
    folder to another)
    > from a
    > now defunct site to the new site I am building. These
    pages were created
    > using
    > frames via Frontpage. Is there a way within Dreamweaver
    to 'convert'
    > these
    > pages to something not frame-based?
    >
    > Thanks!
    >

  • How to use the frameaccess code to convert video frames to jpeg files

    Hello everyone. I am working on a project on video processing, and i need to be able to do image processing on individual video frames. However, to do this, I need to convert the frames to an appropriate format, namely jpeg. It is actually the conversion from buffer frame to BufferedImage that is important, as i already have an approximate knowledge of filewriter for the saving of already rendered file.
    The original frameaccess code can be found here: http://java.sun.com/products/java-media/jmf/2.1.1/solutions/FrameAccess.html
    there are several other threads tied to this topic, some of which do not work for me, or simply do not suit my needs, so please do not link me to them unless you are sure its the real solution.
    if any one could help me by showing me the way of doing it correctly, and maybe give a nice short explanation, i would be very grateful.
    Thanks you.
    P.s: i am only a beginner to intermediate student in java and programming in general so...

    Here is the code i am currently using.
    package Test;
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import javax.media.bean.playerbean.MediaPlayer;
    import javax.media.util.*;
    import java.awt.image.BufferedImage;
    import java.awt.image.RenderedImage;
    import java.awt.image.*;
    import javax.imageio.ImageWriter;
    import javax.imageio.ImageIO;
    import javax.media.control.FrameGrabbingControl;
    * Sample program to access individual video frames by using a
    * "pass-thru" codec. The codec is inserted into the data flow
    * path. As data pass through this codec, a callback is invoked
    * for each frame of video data.
    public class FrameAccess extends Frame implements ControllerListener {
    Processor p;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    * Given a media locator, create a processor and use that processor
    * as a player to playback the media.
    * During the processor's Configured state, two "pass-thru" codecs,
    * PreAccessCodec and PostAccessCodec, are set on the video track.
    * These codecs are used to get access to individual video frames
    * of the media.
    * Much of the code is just standard code to present media in JMF.
    public boolean open(MediaLocator ml) {
         try {
         p = Manager.createProcessor(ml);
         } catch (Exception e) {
         System.err.println("Failed to create a processor from the given url: " + e);
         return false;
         p.addControllerListener(this);
         // Put the Processor into configured state.
         p.configure();
         if (!waitForState(p.Configured)) {
         System.err.println("Failed to configure the processor.");
         return false;
         // So I can use it as a player.
         p.setContentDescriptor(null);
         // Obtain the track controls.
         TrackControl tc[] = p.getTrackControls();
         if (tc == null) {
         System.err.println("Failed to obtain track controls from the processor.");
         return false;
         // Search for the track control for the video track.
         TrackControl videoTrack = null;
         for (int i = 0; i < tc.length; i++) {
         if (tc.getFormat() instanceof VideoFormat) {
              videoTrack = tc[i];
              break;
         if (videoTrack == null) {
         System.err.println("The input media does not contain a video track.");
         return false;
         System.err.println("Video format: " + videoTrack.getFormat());
         // Instantiate and set the frame access codec to the data flow path.
         try {
         Codec codec[] = { new PreAccessCodec(),
                        new PostAccessCodec()};
         videoTrack.setCodecChain(codec);
         } catch (UnsupportedPlugInException e) {
         System.err.println("The process does not support effects.");
         // Realize the processor.
         p.prefetch();
         if (!waitForState(p.Prefetched)) {
         System.err.println("Failed to realize the processor.");
         return false;
         // Display the visual & control component if there's one.
         setLayout(new BorderLayout());
         Component cc;
         Component vc;
         if ((vc = p.getVisualComponent()) != null) {
         add("Center", vc);
         if ((cc = p.getControlPanelComponent()) != null) {
         add("South", cc);
         // Start the processor.
         p.start();
         setVisible(true);
         return true;
    public void addNotify() {
         super.addNotify();
         pack();
    * Block until the processor has transitioned to the given state.
    * Return false if the transition failed.
    boolean waitForState(int state) {
         synchronized (waitSync) {
         try {
              while (p.getState() != state && stateTransitionOK)
              waitSync.wait();
         } catch (Exception e) {}
         return stateTransitionOK;
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
         if (evt instanceof ConfigureCompleteEvent ||
         evt instanceof RealizeCompleteEvent ||
         evt instanceof PrefetchCompleteEvent) {
         synchronized (waitSync) {
              stateTransitionOK = true;
              waitSync.notifyAll();
         } else if (evt instanceof ResourceUnavailableEvent) {
         synchronized (waitSync) {
              stateTransitionOK = false;
              waitSync.notifyAll();
         } else if (evt instanceof EndOfMediaEvent) {
         p.close();
         System.exit(0);
    * Main program
    public static void main(String [] args) throws IOException {
         /*if (args.length == 0) {
         prUsage();
         System.exit(0);
         //String url = args[0];
         String url = new String ("file:D:FiMs/avpr.avi");
         if (url.indexOf(":") < 0) {
         prUsage();
         System.exit(0);
         MediaLocator ml;
         //MediaPlayer mp1 = new javax.media.bean.playerbean.MediaPlayer();
         //mp1.setMediaLocation(new java.lang.String("file:D:/FiMs/299_01_hi.mpg"));
         //mp1.start();
         if ((ml = new MediaLocator(url)) == null) {
         System.err.println("Cannot build media locator from: " + url);
         System.exit(0);
         FrameAccess fa = new FrameAccess();
         if (!fa.open(ml))
         System.exit(0);
    static void prUsage() {
         System.err.println("Usage: java FrameAccess <url>");
    * Inner class.
    * A pass-through codec to access to individual frames.
    public class PreAccessCodec implements Codec {
    * Callback to access individual video frames.
         void accessFrame(Buffer frame) {
         // For demo, we'll just print out the frame #, time &
         // data length.
         long t = (long)(frame.getTimeStamp()/10000000f);
         System.err.println("Pre: frame #: " + frame.getSequenceNumber() +
                   ", time: " + ((float)t)/100f +
                   ", len: " + frame.getLength());
         * The code for a pass through codec.
         // We'll advertize as supporting all video formats.
         protected Format supportedIns[] = new Format [] {
         new VideoFormat(null)
         // We'll advertize as supporting all video formats.
         protected Format supportedOuts[] = new Format [] {
         new VideoFormat(null)
         Format input = null, output = null;
         public String getName() {
         return "Pre-Access Codec";
         // No op.
    public void open() {
         // No op.
         public void close() {
         // No op.
         public void reset() {
         public Format [] getSupportedInputFormats() {
         return supportedIns;
         public Format [] getSupportedOutputFormats(Format in) {
         if (in == null)
              return supportedOuts;
         else {
              // If an input format is given, we use that input format
              // as the output since we are not modifying the bit stream
              // at all.
              Format outs[] = new Format[1];
              outs[0] = in;
              return outs;
         public Format setInputFormat(Format format) {
         input = format;
         return input;
         public Format setOutputFormat(Format format) {
         output = format;
         return output;
         public int process(Buffer in, Buffer out) {
         // This is the "Callback" to access individual frames.
         accessFrame(in);
         // Swap the data between the input & output.
         Object data = in.getData();
         in.setData(out.getData());
         out.setData(data);
         // Copy the input attributes to the output
         out.setFormat(in.getFormat());
         out.setLength(in.getLength());
         out.setOffset(in.getOffset());
         return BUFFER_PROCESSED_OK;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    public class PostAccessCodec extends PreAccessCodec {
         // We'll advertize as supporting all video formats.
         public PostAccessCodec() {
         supportedIns = new Format [] {
              new RGBFormat()
    * Callback to access individual video frames.
         void accessFrame(Buffer frame) {
         // For demo, we'll just print out the frame #, time &
         // data length.
         long t = (long)(frame.getTimeStamp()/10000000f);
         System.err.println("Post: frame #: " + frame.getSequenceNumber() +
                   ", time: " + ((float)t)/100f +
                   ", len: " + frame.getLength());
         public String getName() {
         return "Post-Access Codec";
    and here is what itprabhu5 proposed to use to convert and save the frames as .png(or .jpeg in the same way)
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import javax.imageio.*;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.format.*;
    import javax.media.util.*;
    * Grabs a frame from a Webcam, overlays the current date and time, and saves the frame as a PNG to c:\webcam.png
    * @author David
    * @version 1.0, 16/01/2004
    public class FrameGrab
         public static void main(String[] args) throws Exception
              // Create capture device
              CaptureDeviceInfo deviceInfo = CaptureDeviceManager.getDevice("vfw:Microsoft WDM Image Capture (Win32):0");
              Player player = Manager.createRealizedPlayer(deviceInfo.getLocator());
              player.start();
              // Wait a few seconds for camera to initialise (otherwise img==null)
              Thread.sleep(2500);
              // Grab a frame from the capture device
              FrameGrabbingControl frameGrabber = (FrameGrabbingControl)player.getControl("javax.media.control.FrameGrabbingControl");
              Buffer buf = frameGrabber.grabFrame();
              // Convert frame to an buffered image so it can be processed and saved
              Image img = (new BufferToImage((VideoFormat)buf.getFormat()).createImage(buf));
              BufferedImage buffImg = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
              Graphics2D g = buffImg.createGraphics();          
              g.drawImage(img, null, null);
              // Overlay curent time on image
              g.setColor(Color.RED);
              g.setFont(new Font("Verdana", Font.BOLD, 16));
              g.drawString((new Date()).toString(), 10, 25);
              // Save image to disk as PNG
              ImageIO.write(buffImg, "png", new File("c:\\webcam.png"));
              // Stop using webcam
              player.close();
              player.deallocate();
              System.exit(0);                    
    however, i am unable to use it together with my code... i m not even sure if im using it at the right place.. (note that u will have to discard some lines from the second code, because it is actually grabbing frames from a webcam in that example)
    if any1 can make it happen please help me. thx.

Maybe you are looking for

  • Multi-column Index vs One index for each column

    Hello everyone, i have one table about 20 000 000 rows, some developers have to generate reports on it and i want to create indexes on this table. The table has 34 columns, no primary key, no unique keys. The "where..." clause of the reports usually

  • How can i create a photobook with a layout that respect standard photo format?

    I used iphoto to create a photobook but there is serious problem, i can use only fixed layout and this layouts are problems. I can't put my shoot in standard photographic format, so i need to zoom and move my photo to fit well in your fixed layout. I

  • After Effects Crash

    When starting AE I get this message: After Effects error: Crash in progress.  Last logged message was: <4332> <GPU Manager> <2> Sniffer Result Code: 1 The only time I can get AE to start is if I open it as soon as I turn on the computer.  Any attempt

  • HT1338 Java Plug in not working?

    I have re-installed java several times and can not get the plug in to work.  So frustrating.

  • Interface member variable by defaultly static ?

    Hi, The interface member variable by defaulty public,static,final. But i have one doubt. It is public because it has to access out side the interface. It is final because the value never changes Why it should be static ??? Thanks, Narendra babu.B