Skip to content

Commit

Permalink
fix inverting (Bilevel BW png) in pdf; fixes # 2059
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Oct 27, 2019
1 parent 048f729 commit 4a37cde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,12 @@ bool TessPDFRenderer::imageToPDFObj(Pix *pix,
} else {
switch (cid->spp) {
case 1:
colorspace.str(" /ColorSpace /DeviceGray\n");
if (cid->bps == 1) {
colorspace.str(" /ColorSpace /DeviceGray\n"
" /Decode [1 0]\n");
} else {
colorspace.str(" /ColorSpace /DeviceGray\n");
}
break;
case 3:
colorspace.str(" /ColorSpace /DeviceRGB\n");
Expand Down

0 comments on commit 4a37cde

Please sign in to comment.