GetImageCount
IPDFDocument3 :: General document methods

See Also Example
Collapse All

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

Syntax

LONG GetImageCount ()
Return value
Number of images

Remarks

Equivalent in new interface: IPDFDocument4::GetImageCount.

Example

How to Get the Number of Images in a PDF Document

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.PDFPAGE_ShowImage(i, 10, 100*(i-i1), 122, 89, 0.0);
end;
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
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->PDFPAGE_ShowImage(i, 10, 100*(i-i1), 122, 89, 0.0);
}
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
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.PDFPAGE_ShowImage(i, 10, 100*(i-i1), 122, 89, 0.0);
}
PDF.EndDoc();
Visual Basic
[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
    PDF.PDFPAGE_ShowImage i, 10, 100*(i-i1), 122, 89, 0.0
Next
PDF.EndDoc

See Also

Reference