title: Convert Tiff to Pdf in java using itext
body: <p>I am using the below code for converting tiff to pdf 
  It works fine for tiff images of dimensions 850*1100.But when I am trying to give the input tiff image of dimensions(Eg :- 1574*732, 684*353 or other 850*1100), I am getting the below error. Please help me how to convert tiff images of different dimensions to pdf.</p>
  
  <p>Error Occured for below code .<strong>Compression JPEG is only supported with a single strip. This image has 45 strips.</strong></p>
  
  <pre><code>RandomAccessFileOrArray myTifFile = null;
  com.itextpdf.text.Document tiffToPDF= null;
  PdfWriter pdfWriter = null;
  try{
          myTifFile = new RandomAccessFileOrArray(fileName);
          int numberOfPages = TiffImage.getNumberOfPages(myTifFile);
          tiffToPDF = new com.itextpdf.text.Document(PageSize.LETTER_LANDSCAPE);      
          String temp = fileName.substring(0, fileName.lastIndexOf("."));
          pdfWriter = PdfWriter.getInstance(tiffToPDF, new FileOutputStream(temp+".pdf"));
          pdfWriter.setStrictImageSequence(true);
          tiffToPDF.open();
          for(int tiffImageCounter = 1;tiffImageCounter &lt;= numberOfPages;tiffImageCounter++) 
               {
                  Image img = TiffImage.getTiffImage(myTifFile, tiffImageCounter);
  
                  img.setAbsolutePosition(0,0);
  
                  img.scaleToFit(612,792);
  
                  tiffToPDF.add(img);
  
                  tiffToPDF.newPage();
              } 
  
          }
  </code></pre>