| 479 | |
| 480 | |
| 481 | void Pdf::addImageFromFile( const std::filesystem::path& imagePath, const ImageParams& params ) |
| 482 | { |
| 483 | if ( !checkDocument_( "add image from file" ) ) |
| 484 | return; |
| 485 | |
| 486 | if ( imagePath.empty() ) |
| 487 | { |
| 488 | spdlog::warn( "Pdf: can't add image from file: empty path." ); |
| 489 | return; |
| 490 | } |
| 491 | |
| 492 | HPDF_Image pdfImage = MR_HPDF_CHECK_ERROR( HPDF_LoadPngImageFromFile( state_->document, utf8string( imagePath ).c_str() ) ); |
| 493 | addImage_( { pdfImage }, params ); |
| 494 | } |
| 495 | |
| 496 | void Pdf::addImage( const Image& image, const ImageParams& params ) |
| 497 | { |