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)
- Default value of print scale HOT 1
- Not found - HTML error 404 downloading image HOT 2
- incorrect href mapping (file://) HOT 1
- why does link mapping add the http server port? HOT 2
- NULL Pointer Dereference (SIGSEGV) HOT 1
- Memory Leak HOT 1
- 1.9.17 libcups is required but not mentioned in docs except release note HOT 3
- Broken links after version 1.9.3 HOT 7
- First page header (--header1) does not work (header is blank) HOT 4
- Link not working HOT 13
- Problem with emphasis when converting directly from markdown to pdf HOT 3
- Broken zlib detection on OpenSUSE HOT 2
- Truncated cell HOT 1
- Problem with external URL links HOT 4
- Is it possible to support codepage 437? (e.g. PC graphics) HOT 2
- v1.9.18 Mac version crashes immediately on startup HOT 2
- Links for files in subfolders fail HOT 1
- utf-8 encoding problem. HOT 2
- I am facing the same issue, any new updates?
- AddressSanitizer: out of bounds memory write in parse_paragraph functionin,htmldoc/htmldoc/ps-pdf.cxx:5208 HOT 1
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.