You'll have to post the tiff for inspection.

Paulo
  ----- Original Message ----- 
  From: Hugh McLaughlin 
  To: Post all your questions about iText here 
  Sent: Tuesday, December 13, 2011 2:44 AM
  Subject: Re: [iText-questions] Converting Fax Tiff to PDF


  Thanks again for the response.  I’ve looked through the documentation and 
tried the following:

   

  Dim img = iTextSharp.text.pdf.codec.TiffImage.GetTiffImage(tifArray, pageno)

   

  Dim xValue As String = img.DpiX.ToString

   

  Dim yValue As String = img.DpiY.ToString

   

  I converted to string just to see what it returned.  However, it returned an 
x value of 204 and a y value of 196 which seems abnormally low and out of 
proportion.  I think I’m barking up the wrong tree but I didn’t find anything 
else that looked like it would return a dpi.

   

  From: Paulo Soares [mailto:psoa...@glintt.com] 
  Sent: Monday, December 12, 2011 2:00 PM
  To: Post all your questions about iText here
  Subject: Re: [iText-questions] Converting Fax Tiff to PDF

   

  You'll have to scale in both axis with different values. Use 
iTextSharp.text.pdf.codec.TiffImage. This will return an iTextSharp.text.Image 
with the right X and Y dpi information.

   

  Paulo

     


----------------------------------------------------------------------------

    From: Hugh McLaughlin [mailto:h...@kmcnetwork.com] 
    Sent: Monday, December 12, 2011 5:33 PM
    To: Post all your questions about iText here
    Subject: Re: [iText-questions] Converting Fax Tiff to PDF

    Are you saying do without the line that scales the image?

     

    From: Paulo Soares [mailto:psoa...@glintt.com] 
    Sent: Monday, December 12, 2011 12:39 PM
    To: Post all your questions about iText here
    Subject: Re: [iText-questions] Converting Fax Tiff to PDF

     

    Load the image directly from the tiff or you'll lose the dpi information.

     

    Paulo

       


--------------------------------------------------------------------------

      From: Hugh McLaughlin [mailto:h...@kmcnetwork.com] 
      Sent: Monday, December 12, 2011 5:15 PM
      To: itext-questions@lists.sourceforge.net
      Subject: [iText-questions] Converting Fax Tiff to PDF

      Hello Everyone and thanks for your help in advance.  I am developing an 
application with iTextSharp to transform inbound faxes to PDF files.  However, 
when converted to PDF files, some of the faxes do not display properly, for 
example they appear shortened on the page and out of correct resolution.  All 
of the text appears, but squashed on the page.  It appears that my code does 
not properly account for various dpi settings of the inbound faxes, but I am 
unsure how to account for this.  Here is my code:

       

              ' creation of the document with a certain size and certain 
margins  

              Dim document As New 
iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 0, 0, 0, 0)

       

              ' creation of the different writers  

              Dim writer As iTextSharp.text.pdf.PdfWriter = 
iTextSharp.text.pdf.PdfWriter.GetInstance(document, New 
System.IO.FileStream(DestinationFile, System.IO.FileMode.Create))

       

              ' load the tiff image and count the total pages  

              Dim bm As New System.Drawing.Bitmap(SourceFile)

              Dim total As Integer = 
bm.GetFrameCount(System.Drawing.Imaging.FrameDimension.Page)

       

              document.Open()

              Dim cb As iTextSharp.text.pdf.PdfContentByte = 
writer.DirectContent

              For k As Integer = 0 To total - 1

                  
bm.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, k)

                  Dim img As iTextSharp.text.Image = 
iTextSharp.text.Image.GetInstance(bm, System.Drawing.Imaging.ImageFormat.Bmp)

                  ' scale the image to fit in the page  

                  img.ScalePercent(72.0F / img.DpiX * 100)

                  img.SetAbsolutePosition(0, 0)

                  cb.AddImage(img)

                  document.NewPage()

              Next

              document.Close()

       

      Any help would be greatly appreciated.
------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to