I have extracted the document object from a TIFF image using the following
code -
string strimage = "C:\surendar\Crop1\0770002.tif";
TiffFile tiffFile = new TiffFile(strimage);
Document ds = tiffFile.GetDocument();
page = new Page(756.0f, 1188.0f);
Label label1 = new Label("Hai", 250, 20, 100, 30, Font.HelveticaBold, 30,
TextAlign.Center);
page.Elements.Add(label1);
ds.Pages.Add(page);
ds.Draw(@"C:\surendar\Crop1\SamplePDF.pdf");
I am able to add the image exactly on the PDF but i am not getting the text "Hai" which i placed. Actually it is a sample text that was written here.
Can anyone suggest a way of how to place the text behind the image so that we can write the text as well as image.
We are getting the coordinates from an xml file for the text and we are trying to place the image.
Let me know the solution.
Placing Text behind a Tiff Image in PDF
Re: Placing Text behind a Tiff Image in PDF
Support · Jun 18, 2007Hello,
You can add a label behind the image without any problem. You will have to add the label to the page first and then the image if you want to add the label behind the image, but it will not be visible as the image placed on the label. If you want to see the text then you will have to add the label after adding the image.
In the above code you are addind the label to a new page so it will disply the label in a separate page. Following is the sample code to add the label to an existing Page.
Label label1 = new Label( "Hai", 250, 20, 100, 30, Font.HelveticaBold, 30, TextAlign.Center );
ds.Pages[0].Elements.Add( label1 );
Thanks,
ceTe Software Support Team.