convert .spd file to pdf file - java

I have an .spd file and I want to convert it to pdf file, I looked for libraries over web but couldn't find any.
Actually, my android app gives me spd and jpg file. I am able to convert from jpg to pdf but it takes a lot of time and I also used different libraries for that but got same time for that process. So I switched to convert spd to pdf file, but I am not able to locate any java based library for that.
It would be great if anyone could suggest any library or something.
Thanks

The extension of SPen's files is indeed .spd. I'm afraid that there is currently no official MIME type associated with .spd files.
You can find offical MIME types in the IANA's MIME Media Types register: http://www.iana.org/assignments/media-types
This might help you:
Go to http://developer.samsung.com/samsung-mobile-sdk/sdk Download
the SDK
Inside the binaries there are some programming guides as mentionned
in 1.3 at http://developer.samsung.com/samsung-mobile-sdk
Have a look to ProgrammingGuide_Pen.pdf
See quote like : The sample application saves the data created with
the Pen package in a file. The application supports the SPD format
for Pen data files and the +SPD data format (image file with added
SPD data) for general image files.

Related

How to convert .msg file to PDF using java

I want to generate pdf file from msg file using java. Mail body format should be same. I want to go with java libraries as system where i'm going to run this code may not have outlook installed.
I have tried rtfToHtml(Reader rtf) functions provided online but it is not working properly facing format issues.
I'm looking for open source api.
Thanks in advance.
You can use the free Java Based API Zeonpad. this library provide the api to convert msg file to pdf. Refer http://www.zeonpad.com/app/zeonpad-pdf-api.html
Example:
OutlookToPdf outlookToPdf = new OutlookToPdf();
OutlookToPdf.convert("D:\\input.msg", "D:\\output.pdf");

change .mp3 file format to .aac file format in android using java programming

I have one .mp3 file and I have to convert it into .aac file format.I have made one android app and it will only use .aac files.I have seen many questions on stackoverflow based on this.But didn't get any right solution with code.
So please help with the coding part without using ffmpeg library.

Two applications need to export and import a single file which needs to include data and images, best file type?

I'm making two Java applications one to collect data, another to use it. The one collecting will be importing a file from the other which will include data and images and will be decrypted.
I'm unsure what filetype to use. So far all of the data is in XML and works great but I need the images and was hoping not to have to rely on giving all the images in a folder with a path reference.
Ideas?
well, I think that the best way is to create your own format (.myformat or .data). This file will be in fact a Zip file that contains your XML file and images.
There is no perfect example writen in java as far as I know. However, here are some examples :
Not in java
The best example is, as #Bolo said, the odt format. Indeed, OpenOffice writes the doc in an xml file, and the images too. All that is wrapped in an odt file.
The .exe file is an other example. The C files and the resources are put in a single file. try to open it with 7-zip, you'll see.
The Skyrim plugins are .esp file that contain the dds, the scripts, the niffs (textures)...
In java
The minecraft texture packs are a zip file that contains a .mcmeta file (the infos) and the textures (.png)
Jar files are like exe.
If both programs are in java you could also go with serialization, which is basically saving an object as a file (suffix will be .ser I think) and then being able to retrieve it. You should google it, even if it won't help right now it is quite good to know about it.
I'd suggest using JSON. Gson is a decent library.
You can embed images as byte arrays.
Save the serialized string in a file with a preferred extension, read it from the second application, de-serialize, and reconstruct images.
You can convert binary image data to text with Base64 encoding and this way you can embed your images in XML. [1]: http://en.wikipedia.org/wiki/Base64

finding file extension by java code

Suppose users can upload files, I want to find the extension of the uploaded file.
Even if the user has renamed the extension of the file, I want to find the real extension of that file by it's header or bytecode..etc.
Please help me with a solution.
Note: Not just the extension by substring() or getContentType() but the real file extension,
say for example(in windows), its a .doc file and user renames it to .jpg and uploads it.
Its possible in php, but I don't know how to do that in java! but it can be done.
Thank you.
Apache Commons: FileUpload is a good place to start. further, you could look at the link i referenced: JSP: Get MIME Type on File Upload for hints on how to do this.
As the user states in their question, the thought is if i rename a .png to a .jpg this will fool the getContentType() into thinking it's now a .jpg file. A quick search on google provided the following answer result: Get the mime type from a file that lists 3 very good options:
Apache Tika
The Apache Tika™ toolkit detects and extracts metadata and structured text content from various documents using existing parser libraries
JMimeMagic
jMimeMagic is a Java library for determining the MIME type of files or streams
A java library that claims to help you with this, is: mime-util
Enable Java programs to detect MIME types based on file extensions, magic data and content sniffing. Supports detection from java.io.File, java.io.InputStream, java.net.URL and byte arrays.
A quick search brought this post up: http://fredeaker.blogspot.com/2006/12/file-type-mime-detection.html
The post lists several "magic" libraries that can detect the file type based on its contents.

How to convert .mxd file into .pdf file

I want to convert .mxd file into .pdf file. I have google under this topic but I ended with nothing. I want to know that can I convert .mxd to .pdf directly or do I need to convert using intermediate conversions?
any help would be appreciate.....
thank you.
Typically .mxd files are mapping files created with ESRI ArcGIS. ArcMap has a tool to export a specific section to a pdf.
If you must do this programmatically (not by using a manual tool) you can do this I believe by publishing the MXD as a map service and then using the JavaScript, etc. APIs to make the conversions.
well i found this
http://arcscripts.esri.com/details.asp?dbid=15139

Categories

Resources