i explain in detail
class WhiteSpaceInfo
{
public int pageNo;
public string imageName;
public Size Location;
public Size _Size;
}
now i have a function
public void InsertIntoPdf(List<WhiteSpaceInfo> lst)
{
using (Stream inputPdfStream = new FileStream("sample.pdf",
FileMode.Open, FileAccess.Read, FileShare.Read))
using (Stream outputPdfStream = new FileStream("result.pdf",
FileMode.Create, FileAccess.Write, FileShare.None))
{
var reader = new PdfReader(inputPdfStream);
var stamper = new PdfStamper(reader, outputPdfStream);
//PdfContentByte pdfContentByte = null;
foreach(var item in lst)
{
//insert image at specific location at specific page
}
}
if i insert the image in pdf in foreach loop as you previously stated that it
will duplicate and it is not a good solution . but the images may be all
distinct or some common , i can find the list of distinct imageName, so what i
want is insert the image data in pdf as a resource and use that resource and
insert the the specific image (with loaction and size) in foreach loop.
________________________________
From: 1T3XT BVBA <[email protected]>
To: Post all your questions about iText here
<[email protected]>
Sent: Sunday, 5 August 2012 10:22 PM
Subject: Re: [iText-questions] insert images in multiple pages
On 5/08/2012 14:00, agha ali wrote:
> now suppose i have 20 images i cant make 20 objects of images , i want
> to first loop through images and insert the images and then in the
> second loop use the reference in the the pages . in programming
> scenece make a global object and use the reference
I don't understand the question. Maybe you should rephrase it.
More specifically: what do you mean by 'insert the images' verus 'in the
second loop use the reference'.
All of this happens automagically, doesn't it? The first time you insert
an image, a reference is created.
The same reference is used whenever you use the same image in another page.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
[email protected]
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------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
[email protected]
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