File tree Expand file tree Collapse file tree
src/MarkItDown/Converters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -405,7 +405,22 @@ private PdfExtractionResult BuildExtractionFromExtractedText(IReadOnlyList<PdfPa
405405 private async Task < PdfExtractionResult > BuildExtractionFromPdfPigAsync ( byte [ ] pdfBytes , StreamInfo streamInfo , CancellationToken cancellationToken )
406406 {
407407 var pages = await textExtractor . ExtractTextAsync ( pdfBytes , cancellationToken ) . ConfigureAwait ( false ) ;
408- var pageImages = await imageRenderer . RenderImagesAsync ( pdfBytes , cancellationToken ) . ConfigureAwait ( false ) ;
408+
409+ IReadOnlyList < string > pageImages ;
410+
411+ try
412+ {
413+ pageImages = await imageRenderer . RenderImagesAsync ( pdfBytes , cancellationToken ) . ConfigureAwait ( false ) ;
414+ }
415+ catch ( OperationCanceledException )
416+ {
417+ throw ;
418+ }
419+ catch
420+ {
421+ pageImages = Array . Empty < string > ( ) ;
422+ }
423+
409424 return BuildExtractionFromExtractedText ( pages , pageImages , streamInfo ) ;
410425 }
411426
You can’t perform that action at this time.
0 commit comments