Create files from jnlp

Hello guys, i'm novice in java, thanks for readme.
I want to create, from a java web start application, a code for create a PDF File, and i want show this pdf file automatically with the client program (ie acrobat reader).
I've thought in Runtime.getRuntime().exec('acrord32 destfile') for open the pdf file.
But i have a problem, when i create a pdf file with "itext" i need to save it in disk with "FileOutputStream" (local pc client file), that, i suposse this is impossible en JNLP for security restrictions.
The question is... it's possible to create a pdf file (or txt) file, from jnlp , and show it in the client's machine automatically, without security problems??
Thanks a lot!!!
Edited by: JosepBravo on Jan 8, 2008 7:25 AM

Do you run Ant? *
JosepBravo wrote: I want to create, from a java web start application, a code for create a PDF File, ..
For printing? That seems about all that PDFs are good for. Printing can be done from an entirely sandboxed JWS application. Here is an example..
<http://www.physci.org/jws/#ps>
(Or at least, I think it is an example - I have no printer that I can use to test it!)
JosepBravo wrote: ..and i want show this pdf file automatically with the client program (ie acrobat reader).
Saving a file can be done even from a completely sandboxed application*, but if that is what you need to do for this task, that will not help much, since we can only deal with a javax.jnlp.FileContents while sandboxed, and to invoke the PDF in the default program, you need a java.io.File (or at least the entire path/name).
* Here is an example of two things..
<http://www.physci.org/jws/#fs>
1) Sandboxed file access.
2) Using Ant to digitally sign an application, ready for all-permissions access (see the filetest.zip over on the right).
JosepBravo wrote: I've thought in Runtime.getRuntime().exec('acrord32 destfile') for open the pdf file.
What minimum Java version are you targeting?
If it is 1.6+, it would be better to look to the Desktop.open() or Desktop.print() methods.
JosepBravo wrote: But i have a problem, when i create a pdf file with "itext" i need to save it in disk with "FileOutputStream" (local pc client file), that, i suposse this is impossible en JNLP for security restrictions.
*The question is...
My biggest question for you is "what do you want to offer the end user?". Say it like a feature "The ability to print documents displayed in the app", for example.

Similar Messages

  • Read, Write and create files from java applet.

    Dear All,
    I have created a two files. One is applet and one application file. I am creating a instance of application file in applet. Application file is used for reading, writing and creating files. When I invoke applet from broser it dipslays error wrt file access permission. From the forum search I know that we need to sign the applet / edit the java policy to run the code locally. Final delivery of my code should execute on different system. Its not web. I have created a html page on submitting the form it invokes applet to read the form values from param and needs to update the values in xml file located locally. Please help me on how I can proceed with this fix.
    Thanks in advance.

    Sorry if I have not stated the problem clearly. I need to update content to files hosted in local system using java applets.
    I belive there are two ways to achive that.One with jar signer and one with modifying the java policy file. But this application needs to be installed in different system locally as I have created a application with webpage as useinterface and need to update the content in local files on submission. Not sure on how to modify the java.policy files in each end user system and whats the value we need to update in java policy file. Please help me on the steps to be followed

  • ?move app-created files from ipod touch to standard usb stick via pc

    Hi,
    I would be grateful if anyone can help with this question:
    How do I
    backup app-content-files-I-created to a standard usb stick
        which may involve locating where they are on my pc
    remove app-content-files-I-created from iTunes and from my pc
    (the app in question is the adorable DM1 by Fingerlabs)

    App data is included in the backup that iTunes. The backup is located here. Yu can copy to USB stick and then delete the file from your computer.
    Where iTunes backups are stored on your computer
    The folder where your backup data are stored varies depending on the computer's operating system. Make sure the backup folder is included in your periodic data-backup routine.
    iTunes places the backup files in the following places:
    Mac:~/Library/Application Support/MobileSync/Backup/
    Windows XP:\Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    Note: To quickly access the Application Data folder, click Start, and choose Run. Type %appdata% and click OK.
    Windows Vista and Windows 7:\Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    Note: To quickly access the AppData folder, click Start. In the search bar, type %appdata% and press theReturn key.

  • Creating files from servlets or jsp

    The issue that I have is this
    I've been working with eclipse, netbeans, tomcat, glassfish, servlets and jsps.
    I have a little servlet/jsp web application that create few files from the servlet. Those files I need to make them visible to the browser because they are the end result of the servlets/jsp work.
    When I run the server from netbeans/eclipse they deploy the war file into tomcat/glassfish server and run the app.
    So far there is no problem here, just that.. the files created with the app are created into the project folder.
    If I manually run the server, those files are created in the folder from I started the server, so what I did is get into the deployed/unpacked war and from there start the server.
    Only that way I could make those files visibles to download.
    Is there a better way to do this? (of course, it must be, but I don't know how).
    What I want is, deploy the web-app and make the app create those files at the same folder of the web-app to allow those file could be downloaded, no matter from where or how the server is started.
    In the near future I need to install few web-apps like this at the same server, so I can't still starting the server from the web-app folder (as I did it until now).
    I read about the request.getContextPath(); but it return no the real address just the context address (something like "/my_app"), so when I use that address to create a file, what I get is something lik "/my_app/myFile.txt".
    I hope you can give some advices of how to solve my issue.
    Thanks in advance

    830896 wrote:
    Right now I know the absolute path to the tomcat/glassfish where the web-app is deployed, so I can use that address, but in the future that web-app could be deployed in another server and I can't know what address does it have.
    I wonder if there exists a way to know the current absolute address of the web-app, or a way to create, "%this-web-app-absolute-addres%/someDir/myNewFile.txt"No, you're solving the wrong problem. Don't store files you create in the context of the web application, or even in the context of the application server. Store them somewhere else entirely. Then the person who configures the web application just has to set up the name of the directory where they are stored as a variable for your application.

  • How can I create files from Documents stored in a longraw via OLE

    Hello,
    we use forms 6 in client-server-mode and store documents (pdf, tif, doc ... all is possible) in a longraw using an OLE-container.
    Actually I develop a new application which has to exchange document-files with other servers.
    Is there a simple way to generate files from this long raw?
    What does this OLE do to my file before storing it in the long field.
    Is this OLE still a good format?
    The migration to webforms could be a good opportunity to change something ...
    Maybe we better store the files in the file-system and show them with the show_document procedure.
    Wolfram

    Set your export type to Hard Disk and export to a folder on your hard-drive, and optionally re-import those exported JPGs using a checkbox on the Export panel. 
    When I do exports like this I typically put them in a subfolder of the raw files rather than physically mixed into the raw files, themselves.  If I want to see the raws and jpgs mixed together I can just enable Show Photos in Subfolders.

  • Error Message when creating file from INDCS3 files

    Running, Windows XP, Creative Suite CS3,, Acrobat 8 Pro, and all updates. Unable to create a PDF using the "mulitple files" selection and selecting INDCS3 files on a server, receiving the following error:
    -----Invalid value for parameter 'using" of event 'exportFile'. Expected PDFExportrPreset, but received "standard". Files all open in InDesignCS3, but no PDF file is created. Able to create PDFs directly from IND without any problems.----
    Was able to handle this function in CS2 without any problems. Can you tell me where we are going wrong?
    KEN PANTHEN, Albany, NY

    does it happen with local indesign files, or just those on that (particular) network?

  • Creating files from a table and placing it in a different folders based on ID Column

    I have a table <tab>
    <tab>
    <col1>   <col2> ....
    ID1     Data..
    ID1 Data..
    ID1 Data..
    ID2 Data..
    ID2 Data..
    ID3 Data..
    I've another table which gives me information about the path where to place ID1 data and where to Place ID2 data ..so on
    <tab2> 
    <col1>   <col2>
    ID1       c:\folder1\
    ID2       c:\folder2\
    ID3        c:\folder3\
    I need to create a files like this based on the data and place it in appropriate folder.  any logic to being with will be helpful.
    I think I need to have a for each loop to loop through the main table, and isolate the data based on IDs and place it in an appropriate folder by doing a lookup on <tab2>..
    Neil

    Yes your assumption is correct
    What you need is a foreach loop based on ADO.Net enumerator which iterates through an object variable created in SSIS
    The object variable you will populate inside execute sql task using query below
    SELECT Col1,Col2
    From Table2
    Have two variables inside loop to get each iterated value of col1 and col2
    Then inside loop have a data flow task with oledb source and flat file destination
    Inside OLEDB Source use query as
    SELECT *
    FROM Table1
    WHERE col1 = ?
    Map parameter to Col1 variable inside loop
    Now link this to flat file destination
    Have a variable to generate filename using expression below
    @[User::Col2] + (DT_STR,1,1252) "\\" + (DT_STR,10,1252) @[User::Col1] + ".txt"
    Map this filename variable to connection string property of the flat file connection manager
    Once executed you will get the desired output
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Unable to create files from FORMs6i Patch11

    Hi Frnds,
    I'm executing a stored procedure from the back-end to create an XML file.This is working fine with the back-end i.e. ORACLE10g.
    But when the stored procedure is executed within the FORMS then it executes without any error but the file is not created.
    Please assist ... Its very urgent...
    Regards,
    Jignesh S

    Well, firstly, there's nothing urgent around here compares to anyone elses questions, so don't even thing about stating it as urgent.
    Are you closing your files off after creating each one?
    What version of Oracle are you using?
    Can you show us your code or are we supposed to guess at what you are doing?

  • Create file from template format problem

    Hi
    I have a template (index.dwt.asp). In the body tag is
    <body id="<% =xid %>" class="<% =bodyclass %>" onload="SwitchMenu('<% =loadm %>')">
    when I create a new from template it writes the code with a capital L in the onload function which will not validate as xhtml strict.
    <body id="<% =xid %>" class="<% =bodyclass %>" onLoad="SwitchMenu('<% =loadm %>')">
    Is there any thing that can be done to stop this.
    Thanks
    Paul M

    Also, just so you'll know, I cannot reproduce this in CS4.  If I create a template -
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <body id="<% =xid %>" class="<% =bodyclass %>" onload="SwitchMenu('<% =loadm %>')">
    <!-- TemplateBeginEditable name="EditRegion3" -->EditRegion3<!-- TemplateEndEditable -->
    </body>
    </html>
    and spawn a child from it, here is what I get -
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html><!-- InstanceBegin template="/Templates/test-onload.dwt.asp" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    </head>
    <body id="<% =xid %>" class="<% =bodyclass %>" onload="SwitchMenu('<% =loadm %>')">
    <!-- InstanceBeginEditable name="EditRegion3" -->EditRegion3<!-- InstanceEndEditable -->
    </body>
    <!-- InstanceEnd --></html>

  • Create files from template using flienames in a text document.

    Hi
    I have been trying to wrap my head around this all evening and not gotten very far.  I have a template Word document that I need to copy and rename with pupils names.  I have the text document (.txt), with all the pupil names seperated into paragraphs.  I have to do this every term and end up typing all 200 pupils names in by hand.  I know there is a way do this with applescripts, but its not going well. Any and all help would be appreciated.
    Thanks!

    That's pretty easy to do. This should get you close:
    set the_template_file to (choose file with prompt "Select the template file:")
    set the_name_list_file to (choose file with prompt "Select the file containing the names:")
    set the_names_list to paragraphs of (read the_name_list_file)
    tell application "Finder"
              repeat with each_name in the_names_list
                        set new_file to duplicate the_template_file
                        set name of new_file to each_name & ".docx"
              end repeat
    end tell
    The script will first ask you for the template file, then ask you for the file that contains the list of names.
    It then loops through the list of names, for each name it duplicates the template file, then renames it to match the contents of the file.
    There's no error checking here, so you might want to pad this script to catch errors, but it should be functional.

  • Create File from Variable

    I have an Image variable that is loaded with an Image. Is there a way I can stream this variable to a new file on my computer?
    Mediocre Access 2010 | (Baby) Beginner C Sharp | OK at Active Directory (2012) | Fragmented understanding of DNS/DHCP | Laughable experience with Group Policy | Expert question asker on MSDN Forums

    If only I would search the MSDN a little more before bothering you kind folks... think of all the extra time you would have.
    Mediocre Access 2010 | (Baby) Beginner C Sharp | OK at Active Directory (2012) | Fragmented understanding of DNS/DHCP | Laughable experience with Group Policy | Expert question asker on MSDN Forums

  • How do i make it so iTunes plays the music files from where i have chosen to store them?

    how do i make it so iTunes plays the music files from where i have chosen to store them as opposed to it scattering copies of my files into a myriad different folders based on the albums they came from when i'm not even interested in keeping whole albums?
    I recently converted myself to mac after having been a windows formatted person since the beginning of time. I use last.fm and the client scrobbler only supports iTunes on the mac (scobbling since Nov 06 and i'm now heavily dependant upon it as a means of discovering new music) - if you don't know what that means then take it for granted i have no option other than to use iTunes as my media player whn using the mac. And almost immediately upon using iTunes i was filled with horror.
    My tale of woe as follows: I copy all my mp3 files to folder X on my new mac. I copy my simple playlist in to that same folder X. The simple playlist simply lists all the files in folder X in the order i want to hear them in... simple right? And what happens the moment i start playing my simple list? Well you probably all ready know; itunes throws copies of all those files in to the air, scatters them to the four winds so each of them fall into a little folder of their own representing the album they might once have come from. I don't keep whole albums. For me the 'album experience' is a ruse to trick one into listening to weaker material. I only keep the concentrated goodness. I only put up with albums in a previous lifetime because in the days of vinyl i had no other choice apart from spending hours compiling mix tapes. Now i am liberated from these restrictions and have been for the 15 or so years i've been using a computer to listen to music. Until along comes iTunes forcing me backwards in time, frog marching me back into the past.
    That simple list i mentioned is my one and only playlist. This single playlist has been evolving for 15 years as tracks are added and removed and their position in the list changes because that song sounds amazing when heard after that other song whereas hearing this song after that song would be like pouring custard over your sausages (for me shuffling is an abomination). And so here is how i've managed this list and managed synchronization of said list and listed files with my mp3 player (currently a Zen).
    Adding a new file: After deciding that song is a keeper i will copy it into that simple folder that holds all my music and drop it in to a position on the list i deem most suited for it. Incidentally over this entire 15 year (i'm pretty sure it's been around that long) my media player has been winamp but for the reason previously mentioned i am unable to use winamp in mac world.
    Removing a file: fortunately winamp has an option to simultaneously remove a file from the list and the hard drive. And naturally so because after all if i no longer like a song then i want it expunged completely from life or at least from my hard drive and playlist. In the brave new world of iTunes i have to remove from the list there then delete the file from where iTunes copied it from and then the place iTunes copied it to.
    Editing the list: drag an item in the list to it's preferred location and select to save it as i would for any other file using any other application... well desktop type application as opposed to one that uses a database as its primary means of storage.
    Syncing with the mp3 player: copy drag drop playlist file from the simple folder on the hard drive to the simple folder on the mp3 player as i would for any other file. And then also copy drag drop the most recently created files from simple folder on hard drive to simple folder on player after having ordered them by creation date so as to make it easier to select the most recently created. After a while the mp3 player will fill up with the files no longer on the list so i will delete all files from player then re-copy all flies from simple folder on hard drive to simple folder on mp3 player.
    I do not make changes to the list on the mp3 player so synchronization needs only to go one way: from laptop to player.
    So all very simple. Apart from editing the positions of files in the list everything is managed by copy drag dropping and deleting files using windows explorer.
    But i'm in a mac and circumstances have forced me in to the corner of using iTunes. And this whole iTunes situation is terrifying for me as over the years i've heard horror stories about it deleting all of someone's music files. Perhaps this may have been by using the software incorrectly but even so, the very fact that it appears possible for this to happen simply by using the software incorrectly and the fact that it happens with some degree of frequency given the number of reports of this happening that i have heard of over the years on music discussion forums fills me with dread that i have to now use this software. And given the software's blatant disregard for the user's choice as to where to store his/her files it's no surprise that this happens. The software is pointlessly doing dangerous things with my data. Please make it stop.
    Please can i just at the very least make iTunes play the music from the folder i have chosen to put my files in and not copy those files here there and everywhere without my say so? Thankyou.

    option discovered in preferences. Really this and any feature that moves deletes or edits a users data should as far as possible be OFF BY DEFAULT. It shouldn't by default and without the users specific say do this dangerous and unnecessary thing without even letting the user know what it's doing!!! And then cause me a few hours (as i'm new to mac) searching for the option so as to switch it off. If i hadn't noticed the status cage declaring that it was copying files then i might never have twigged that this insane thing was occurring. And if i hadn't of noticed i would have been left maintaining the contents of the folder i copied the files to, the folder which as far as i was informed and so believed was also the location of the music files i was playing. How does Apple justify this 'genius' piece of software non-design? Surely it will hurt no one if this was off by default for new users - overall at least i dare say it would cause a lot less distress in the future for the unsuspecting public at large. Thanks for the support.

  • How to append in an encoder created file

    I'm using XMLEncoders and XMLDecoders for storage of java objects. Currently I've tried on simple data types only. But the problem is if I want to operate on the XMLEncoder created file from two different programs, then it is giving errors. In one program I'm executing
    XMLEncoder e = new XMLEncoder(new BufferedOutputStream
    (new FileOutputStream("polledobjects.xml")));
    e.writeObject(...);
    e.writeObject(...);
    e.close();
    and in another program I want to append to append a few more objects in the same polledobjects.xml, so I created another XML encoder object and opened the polledobjects.xml in append mode.
    XMLEncoder e1 = new XMLEncoder(new BufferedOutputStream(new
    FileOutputStream("polledobjects.xml",true)));
    e1.writeObject(...);
    e1.writeObject(...);
    e1.close();
    Now, Decoder works fine till the point it goes thru xml portion created by the first program, but as soon as it reached xml portion created by the second program, it gives the error->
    java.lang.ArrayIndexOutOfBoundsException: 2
    at java.beans.ObjectHandler.dequeueResult(XMLDecoder.java:272)
    at java.beans.XMLDecoder.readObject(XMLDecoder.java:150)
    at Convert.main(Convert.java:57)
    XML file created is :-
    <?xml version="1.0" encoding="UTF-8"?>
    <java version="1.4.2" class="java.beans.XMLDecoder">
    <object class="Data_to_Poll">
    <void property="active">
    <boolean>true</boolean>
    </void>
    <void property="agent">
    <string>192.9.200.151</string>
    </void>
    </object>
    </java>
    <?xml version="1.0" encoding="UTF-8"?>
    <java version="1.4.2" class="java.beans.XMLDecoder">
    <object class="Data_to_Poll">
    <void property="active">
    <boolean>true</boolean>
    </void>
    <void property="agent">
    <string>192.9.200.151</string>
    </void>
    </object>
    </java>
    I know it is giving problems b'cos it is encountering <?xml tag 2 times in the same xml document, but what should I do if I want to append in the same xml file and in the second program nothing more than filename is known...
    plz. help me out....

    Well, Instead of writing different objects in the same stream.
    e.writeObject(obj1);
    e.writeObject(obj2);
    First put them in some collection. for eg. a List or Set
    Set set = new HashSet();
    set.add(obj1);
    set.add(obj2);
    and then serialize the set e.writeObject(set);
    Does this sound like a solution ?

  • Consuming web service in PI 7.3 and creating file

    Hi,
    I need to consume web service in PI 7.3 and create file from response. I have WSDL for the web service. Now confused about datatype/message type. Is there any document/note to follow?
    thanks,
    7Z

    I need to consume web service in PI 7.3 and create file from response. I have WSDL for the web service. Now confused about datatype/message type. Is there any document/note to follow?
    ==>
    Hi,
    There are 2 ways you can do this :-
    If your sender is a file and receiver is a webservice and you want to map the response back to the file then :-
    Sol 1 :- Async-Sync Bridge using RequesResponse Oneway bean
    Sender File channel ---> Soap Receiver Channel
    Soap Receiver Channel brings the response back to the File Receiver Channel.
    Now this File Receiver Channel should be called inside the Sender File Channel using the above bean.
    Data Type :
    Src - File struc to SOAP request (WSDL used as an external definition)(mapping 1)
    SOAP response(WSDL used as an external definition) to Tgt File Struc (mapping 2)
    Sol 2 :- Async Scenario
    Make a Sender File Channel --> use SOAP lookup channel (pass the request payload through the SOAP receiver channel) --> Map the response back to the File using File Receiver Channel.
    Data Type:
    Src - File struc to Tgt File Struc (mapping 1). Since you are passing the request payload through SOAP lookup in the UDF itself.
    ======================================================================

  • How to create file form servlet in our virtual directory

    hi....
    I want to create a file form my servlet in my virtual directory..
    my directory name ia vps
    it cconatin vps -> WEB-INF -> classes-> servTest
    servTest is servlet....
    and i want to create file from servTest in vps directory..
    actually i am trying to create file but it by default saved in windows/system32 directory.

    You need to give the absolute path to create the file, if you just give the filename, the file will be created in the working directory which is system32 for Windows.
    You could either hardcode it, or you can use ServletContext.getRealPath("/") ( http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String) ) This will return the path on the server's filesystem where your application folder ( under webapps for Tomcat) is located.
    NOTE: If you application is in the form of a .war file, this may not work! The server may return a null.
    "/" specifies the root i.e., your application's highest level directory. If your application is webapps/vps then getRealPath("/") will return something like C:\Program Files\Apache Group\Tomcat 4.1\webapps\vps

Maybe you are looking for

  • Can't sync iPhone after computer upgrade

    I just upgraded my notebook hard drive and started everything on the computer - including my iTunes library - over from scratch. Unfortunately, even though this is the same computer I was using before (albeit with a new hard drive, and upgraded to Le

  • How to check the tables

    Dear experts! Thank you for your attention! I have studied the SAP SD for half a year, though I still don't know how to check certain table like: KNVS---customer master shipping data KNBK---customer master (bank detail) ADR---address table ect. could

  • Report for unreleased service entry sheet

    Hi All Is there any report where I can get list of service entry sheet numbers which are yet to be completely released.

  • Adobe ReadOutLoud with Windows 8

    How do you get Adobe ReadOutLoud to work with Windows 8?

  • Java VM Please help, Cannot remove and cannot Reinstall.

    hello, I hope somebody can help me out here, I'm at my wits end. First of all I have xp pro file system NTFS, I have AOL DSL Broad band. I have attempted to get my Java Download DAYS ago and something went terribly wrong. After the download I noticed