Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Images
Collapse All

This method retrieves the number of images in the current PDF document.

Syntax

LONG GetImageCount ()
Return value
Number of images in the document's images collection

Example

Retrieving the Number of Images

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
i1 := PDF.AddImageFromFile('picture.gif');
PDF.AddImageFromFile('other_1.gif');
PDF.AddImageFromFile('other_2.gif');
{ add some more pictures               }
PDF.AddImageFromFile('other_N.gif');

n := i1 + PDF.GetImageCount;
for i := i1 to n-1 do
begin
    PDF.ShowImage(i, 10, 100*(i-i1));
end;
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long i1 = PDF->AddImageFromFile("picture.gif");
PDF->AddImageFromFile("other_1.gif");
PDF->AddImageFromFile("other_2.gif");
// add some more pictures
PDF->AddImageFromFile("other_N.gif");

long n = i1 + PDF->GetImageCount();
for (long i = i1; i < n; i++)
{
    PDF->ShowImage(i, 10, 100*(i-i1));
}
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long i1 = PDF.AddImageFromFile("picture.gif");
PDF.AddImageFromFile("other_1.gif");
PDF.AddImageFromFile("other_2.gif");
// add some more pictures
PDF.AddImageFromFile("other_N.gif");

long n = i1 + PDF.GetImageCount();
for (long i = i1; i < n; i++)
{
    PDF.ShowImage(i, 10, 100*(i-i1));
}
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
i1 = PDF.AddImageFromFile("picture.gif")
PDF.AddImageFromFile("other_1.gif")
PDF.AddImageFromFile("other_2.gif")
' add some more pictures
PDF.AddImageFromFile("other_N.gif")

n = i1 + PDF.GetImageCount()
For i = i1 To n-1
    PDF.ShowImage i, 10, 100*(i-i1)
Next
PDF.SaveToFile "test.pdf", true

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots