mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
pdf: Print PDF version; tweak output
This commit is contained in:
parent
ea89053c12
commit
f418605ec7
1 changed files with 9 additions and 2 deletions
|
@ -33,6 +33,14 @@ static PDF::PDFErrorOr<void> print_document_info_dict(PDF::Document& document)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PDF::PDFErrorOr<void> print_document_info(PDF::Document& document)
|
||||||
|
{
|
||||||
|
outln("PDF Version: {}.{}", document.version().major, document.version().minor);
|
||||||
|
outln("Number of pages: {}", document.get_page_count());
|
||||||
|
TRY(print_document_info_dict(document));
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
static PDF::PDFErrorOr<int> pdf_main(Main::Arguments arguments)
|
static PDF::PDFErrorOr<int> pdf_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
|
@ -54,8 +62,7 @@ static PDF::PDFErrorOr<int> pdf_main(Main::Arguments arguments)
|
||||||
|
|
||||||
TRY(document->initialize());
|
TRY(document->initialize());
|
||||||
|
|
||||||
outln("{} pages", document->get_page_count());
|
TRY(print_document_info(*document));
|
||||||
TRY(print_document_info_dict(*document));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue