2021-04-10 14:00:52 +02:00
|
|
|
|
//
|
|
|
|
|
// Test program for pdfio.
|
|
|
|
|
//
|
|
|
|
|
// Copyright © 2021 by Michael R Sweet.
|
|
|
|
|
//
|
|
|
|
|
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
|
|
|
|
// information.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Include necessary headers...
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include "pdfio.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// 'main()' - Main entry for test program.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
int // O - Exit status
|
|
|
|
|
main(int argc, // I - Number of command-line arguments
|
|
|
|
|
char *argv[]) // I - Command-line arguments
|
|
|
|
|
{
|
2021-05-01 17:50:17 +02:00
|
|
|
|
if (argc > 1)
|
|
|
|
|
{
|
|
|
|
|
int i; // Looping var
|
|
|
|
|
pdfio_file_t *pdf; // PDF file
|
|
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i ++)
|
|
|
|
|
{
|
|
|
|
|
if ((pdf = pdfioFileOpen(argv[i], NULL, NULL)) != NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("%s: PDF %s, %d objects.\n", argv[i], pdfioFileGetVersion(pdf), (int)pdfioFileGetNumObjects(pdf));
|
|
|
|
|
pdfioFileClose(pdf);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-10 14:00:52 +02:00
|
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
|
}
|