Comments (2)
Original reporter: Michael Sweet
Fixed in CVS - the anonymous CVS repository will be updated at midnight EST.See attached patch...
from htmldoc.
"str32.patch":
Index: ps-pdf.cxx
===================================================================
RCS file: /development/cvs/htmldoc1/htmldoc/ps-pdf.cxx,v
retrieving revision 1.89.2.260
diff -u -r1.89.2.260 ps-pdf.cxx
--- ps-pdf.cxx 4 Oct 2004 20:59:51 -0000 1.89.2.260
+++ ps-pdf.cxx 20 Oct 2004 18:21:16 -0000
@@ -2659,8 +2659,17 @@
if (box[0] != r->data.box[0] ||
box[1] != r->data.box[1] ||
box[2] != r->data.box[2])
- flate_printf(out, "%.2f %.2f %.2f RG\n", box[0] = r->data.box[0],
- box[1] = r->data.box[1], box[2] = r->data.box[2]);
+ {
+ box[0] = r->data.box[0];
+ box[1] = r->data.box[1];
+ box[2] = r->data.box[2];
+
+ if (OutputColor)
+ flate_printf(out, "%.2f %.2f %.2f RG\n", box[0], box[1], box[2]);
+ else
+ flate_printf(out, "%.2f G\n",
+ box[0] * 0.31f + box[1] * 0.61f + box[2] * 0.08f);
+ }
flate_printf(out, "%.1f %.1f m %.1f %.1f l S\n",
r->x, r->y, r->x + r->width, r->y);
@@ -9382,10 +9391,24 @@
render_rgb[1] = rgb[1];
render_rgb[2] = rgb[2];
- if (PSLevel > 0)
- fprintf(out, "%.2f %.2f %.2f C ", rgb[0], rgb[1], rgb[2]);
+ if (OutputColor)
+ {
+ // Output RGB color...
+ if (PSLevel > 0)
+ fprintf(out, "%.2f %.2f %.2f C ", rgb[0], rgb[1], rgb[2]);
+ else
+ flate_printf(out, "%.2f %.2f %.2f rg ", rgb[0], rgb[1], rgb[2]);
+ }
else
- flate_printf(out, "%.2f %.2f %.2f rg ", rgb[0], rgb[1], rgb[2]);
+ {
+ // Output grayscale...
+ if (PSLevel > 0)
+ fprintf(out, "%.2f G ",
+ rgb[0] * 0.31f + rgb[1] * 0.61f + rgb[2] * 0.08f);
+ else
+ flate_printf(out, "%.2f g ",
+ rgb[0] * 0.31f + rgb[1] * 0.61f + rgb[2] * 0.08f);
+ }
}
@@ -11070,15 +11093,13 @@
fputs("/BD{bind def}bind def", out);
fputs("/B{dup 0 exch rlineto exch 0 rlineto neg 0 exch rlineto\n"
"closepath stroke}BD", out);
- if (!OutputColor)
- fputs("/C{0.08 mul exch 0.61 mul add exch 0.31 mul add setgray}BD\n", out);
- else
- fputs("/C{setrgbcolor}BD\n", out);
+ fputs("/C{setrgbcolor}BD\n", out);
fputs("/CM{concat}BD", out);
fputs("/DF{findfont dup length dict begin{1 index/FID ne{def}{pop pop}\n"
"ifelse}forall/Encoding fontencoding def currentdict end definefont pop}BD\n", out);
fputs("/F{dup 0 exch rlineto exch 0 rlineto neg 0 exch rlineto closepath fill}BD\n", out);
fputs("/FS{/hdFontSize exch def}BD", out);
+ fputs("/G{setgray}BD\n", out);
fputs("/GS{gsave}BD", out);
fputs("/GR{grestore}BD", out);
fputs("/J{0 exch ashow}BD\n", out);
from htmldoc.
Related Issues (20)
- AddressSanitizer: heap-buffer-overflow in function pdf_write_names HOT 7
- LeakSanitizer: detected memory leaks HOT 1
- AddressSanitizer: heap-buffer-overflow in function pdf_write_links at ps-pdf.cxx:3371 HOT 2
- AddressSanitizer: heap-buffer-overflow in function parse_table at ps-pdf.cxx:7198 HOT 1
- AddressSanitizer: heap-buffer-overflow in function parse_paragraph at ps-pdf.cxx:5203 HOT 3
- Question regarding timezone HOT 1
- Barcode missing HOT 10
- Please make a new release HOT 2
- gmtime_r/localtime_r on MinGW-w64 HOT 4
- Use UTC date/time for PS/PDF file metadata HOT 5
- add (Google) webp image support HOT 1
- Set paper size HOT 1
- Problems with running configure on SLES12SP5 / zlib HOT 14
- Table row without closing tag no longer rendered correctly HOT 5
- Fonts character set needs an app restart to be applied in case of a second (and more file generation) HOT 3
- Accented characters cause display issues in v1.9 this was OK in v1.8 HOT 3
- Solaris 11.4 Compile: error: ‘struct std::tm’ has no member named ‘tm_gmtoff’ HOT 1
- IMages not showing.. HOT 2
- CSS Support HOT 2
- Encoding breaks for special characters HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htmldoc.