Skip to content

Commit

Permalink
fix tesseract-ocr#369 - pdf output with transparent background image
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Aug 5, 2016
1 parent a7307e3 commit fd26a22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,9 @@ bool TessPDFRenderer::imageToPDFObj(Pix *pix,
int format, sad;
findFileFormat(filename, &format);
if (pixGetSpp(pix) == 4 && format == IFF_PNG) {
pixSetSpp(pix, 3);
sad = pixGenerateCIData(pix, L_FLATE_ENCODE, 0, 0, &cid);
Pix *p1 = pixAlphaBlendUniform(pix, 0xffffff00);
sad = pixGenerateCIData(p1, L_FLATE_ENCODE, 0, 0, &cid);
pixDestroy(&p1);
} else {
sad = l_generateCIDataForPdf(filename, pix, kJpegQuality, &cid);
}
Expand Down

0 comments on commit fd26a22

Please sign in to comment.