Solved

TIFF + PDF using Java

Posted on 2004-08-12
14
8,810 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
ID: 11782920
0
 
LVL 35

Expert Comment

by:girionis
ID: 11782933
0
 
LVL 35

Expert Comment

by:girionis
ID: 11782946
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
ID: 11785446
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
ID: 11786927
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
ID: 11790147
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
ID: 11795252
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 23

Author Comment

by:rama_krishna580
ID: 11798465
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
ID: 11804462
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
ID: 11807398
That's almost the same link I posted, isn't it?
0
 
LVL 23

Author Comment

by:rama_krishna580
ID: 11808689
Hi girionis,

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

R.K
0
 
LVL 35

Expert Comment

by:girionis
ID: 11808707
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
ID: 11808713
0
 
LVL 35

Expert Comment

by:girionis
ID: 11808717
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PDF to HTML conversion that looks good on Android Phones 3 87
Java SE 8u111  Lot of stuff broke 11 54
more than one jdk and one jre 1 34
java stored proc example 9 24
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 tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

863 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

25 Experts available now in Live!

Get 1:1 Help Now