mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 11:06:10 +00:00
pdf: Print PDF version; tweak output
This commit is contained in:
parent
ea89053c12
commit
f418605ec7
Notes:
sideshowbarker
2024-07-17 17:06:59 +09:00
Author: https://github.com/nico
Commit: f418605ec7
Pull-request: https://github.com/SerenityOS/serenity/pull/19948
Reviewed-by: https://github.com/trflynn89
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 {};
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Core::ArgsParser args_parser;
|
||||
|
@ -54,8 +62,7 @@ static PDF::PDFErrorOr<int> pdf_main(Main::Arguments arguments)
|
|||
|
||||
TRY(document->initialize());
|
||||
|
||||
outln("{} pages", document->get_page_count());
|
||||
TRY(print_document_info_dict(*document));
|
||||
TRY(print_document_info(*document));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue