Solved

TIFF + PDF using Java

Posted on 2004-08-12
14
8,803 Views
Last Modified: 2013-12-02
Hi Experts,

I am looking for Java-API's OR any sample applications to combine TIFF format file + PDF file = results in PDF / TIFF.
(I am using for Java Stand-alone application).

1. TIFF + PDF --> PDF   OR
2. TIFF + PDF --> TIFF

you help and comments will be appreciated..

Thank you

R.K
0
Comment
Question by:rama_krishna580
  • 7
  • 5
  • 2
14 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
Comment Utility
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
The above link is part of the Java Media API: http://java.sun.com/products/java-media/
0
 
LVL 23

Author Comment

by:rama_krishna580
Comment Utility
Hi,

Thank you for your links and info,
but i am looking for sample Java-Application / JAR files to full fill my problem...anyway i will go through the links u provided.

R.K
0
 
LVL 1

Expert Comment

by:SlimHealer
Comment Utility
Here's a quick example I cobbled together.

//  MMcDougall
//
//      Example: Use JAI to read in files a tiff and a jpeg file, combinet
//  them and write out a jpeg file  
//
//
//      For the example to work, you need to get a pair of files
//      (tiff and jpeg respectively), and name them appropriately
//
//            ../images/jello.tif
//            ../images/clown800.jpg
//
//

import java.awt.image.RenderedImage;
import java.io.File;
import java.io.FileOutputStream;
import javax.media.jai.JAI;

public class TestCase  {
      final static String currDir = System.getProperty( "user.dir" ) + File.separator + "Images" + File.separator;
      final static String inputFile1 = currDir + "jello.tif";
      final static String inputFile2 = currDir + "clown800.jpg";
      final static String outputFile = currDir + "mixed.jpg";
      
      public static void main(String[] args) {
            RenderedImage img1;
            RenderedImage img2;
            RenderedImage mixed;
            System.out.println(currDir);
            try {
                  System.out.println("Reading " + inputFile1);
                  img1 = JAI.create("fileload", inputFile1);
                  
                  System.out.println("Reading " + inputFile2);
                  img2 = JAI.create("fileload", inputFile2);
                  
                  System.out.println("Combine the imges together.");
                  RenderedImage dst = (RenderedImage)JAI.create("add", img1, img2);
                  
                  System.out.println("writing result to " + outputFile);
                  FileOutputStream stream = new FileOutputStream(outputFile);
                  JAI.create("encode", dst, stream, "JPEG", null);
                  JAI.create("filestore", dst, outputFile, "JPEG", null);
            }
            catch( Exception x) {
                  System.out.println("Unexpected exception " + x);
                  x.printStackTrace();
            }
      }
}
0
 
LVL 23

Author Comment

by:rama_krishna580
Comment Utility
Hi Slim,

Thanks, for your example, but i want exactly..like..i say above..

1. TIFF + PDF --> PDF   OR
2. TIFF + PDF --> TIFF

i am waiting for more responses....

R.K
0
 
LVL 1

Expert Comment

by:SlimHealer
Comment Utility
Dow!  Not enough sleep yesterday.  PDF != JPEG, that's for sure.  My example sure looks silly in the clear light of seven hours of sleep and 2 cups of coffee.  Sorry.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 23

Author Comment

by:rama_krishna580
Comment Utility
Hi,

If anyone can provide this also, that will be fine...

Convert PDF ---> TIFF or TIFF --> PDF and murging multiple files (TIFF / PDF) together..

R.K
0
 
LVL 23

Author Comment

by:rama_krishna580
Comment Utility
Hi all,

Thanks for your suggestions, actually i have found the solution @ http://itextpdf.sourceforge.net/

So any way thanx for suggestions.

R.K
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
That's almost the same link I posted, isn't it?
0
 
LVL 23

Author Comment

by:rama_krishna580
Comment Utility
Hi girionis,

Ok, i will give u the points....

R.K
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
You don't have to if you feel you haven't been helped. Just ask a question to the community support to PAQ the question and refund the points back to you.
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
BAh.. too slow. Thank you for accepting, but if you still feel there is not enough info here just ask a question to Community Support for PAQ & Refund :)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
In a previously published article (http://www.experts-exchange.com/articles/10331/Automatic-Duplex-Scanning-in-PaperPort-Versions-11-12-14.html) here at Experts Exchange, I explained how to achieve duplex (double-sided) scanning in Nuance's PaperPor…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now