Fabrizio, 

this is my C# code and with it, I can create a PDF image.

But I need to add text in BACK-LAYOUT using the OCR values (see previous
message).

Can you help me with C# code :working: ???

Thanks =)

-----------------------------------------------------------------------------------------
string pdf = @"C:\test.pdf";
Bitmap bmp = new Bitmap(@"C:\test.pdf");
System.Drawing.Image image = bmp;
// step 1: creation of a document-object with document-metadata
Document document = new Document(PageSize.A4);
// step 2: creation of the writer
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(pdf,
FileMode.OpenOrCreate));
// step 3: open the document
document.Open();
// step 4: grab the ContentByte and do some stuff with it
PdfContentByte cb = writer.DirectContent;

      // step 4.1: grab the Image
      RandomAccessFileOrArray rfa = new
RandomAccessFileOrArray(imageToByteArray(image));
      iTextSharp.text.Image img =
iTextSharp.text.pdf.codec.TiffImage.GetTiffImage(rfa, 1);
      img.SetAbsolutePosition(0, 0);
      img.ScaleAbsolute(594f, 842f);
      cb.AddImage(img);

      // step 4.2: grab the Text
      
         ???_OCR values (see previous message)_???

// step 5: we close the document
document.Close();
-----------------------------------------------------------------------------------------



Fabrizio Accatino wrote:
> 
> try this...
> 
> 
> 1 - create a new pdf
> 2 - add a new page
> 3 - add plain text (use white as text color)
> 4 - add the tiff (it covers all the page)
> 
> 
> Fabrizio
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> 

-- 
View this message in context: 
http://www.nabble.com/itextsharp-for-reproduce-PDF-searchable-form-TIFF-image-tp20657970p20662793.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to