More than 4 years ago I asked nearly the same question, alas with no response. I am trying again ...
I would like to translate an output file from SMCL format into a PDF file using blue color for results (bold font). To do so, first I am using -translator set- to specify the color (and other things) for the translator smcl2pdf followed by -translate-. However, the color of results in the resulting .pdf-file is black (bold font) instead of blue (bold font).
In the following I show the colors I would like them to be together with the -translator set- and -translate- commands I am using:
Is there anything I am doing wrong, for example the specification of the results color as (0 0 139)? Or could it be possible that the color setting simply does not work with Unix (I am using Linux Ubuntu 20.04)?
I would like to translate an output file from SMCL format into a PDF file using blue color for results (bold font). To do so, first I am using -translator set- to specify the color (and other things) for the translator smcl2pdf followed by -translate-. However, the color of results in the resulting .pdf-file is black (bold font) instead of blue (bold font).
In the following I show the colors I would like them to be together with the -translator set- and -translate- commands I am using:
Code:
. clear all
. cap log close
. log using "test_2pdf.smcl", replace
--------------------------------------------------------------------------------------------------------------------------------------------
name: <unnamed>
log: /home/enzmann/test_2pdf.smcl
log type: smcl
opened on: 4 Nov 2024, 01:38:18
.
. sysuse auto, clear
(1978 automobile data)
. sum _all
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
make | 0
price | 74 6165.257 2949.496 3291 15906
mpg | 74 21.2973 5.785503 12 41
rep78 | 69 3.405797 .9899323 1 5
headroom | 74 2.993243 .8459948 1.5 5
-------------+---------------------------------------------------------
trunk | 74 13.75676 4.277404 5 23
weight | 74 3019.459 777.1936 1760 4840
length | 74 187.9324 22.26634 142 233
turn | 74 39.64865 4.399354 31 51
displacement | 74 197.2973 91.83722 79 425
-------------+---------------------------------------------------------
gear_ratio | 74 3.014865 .4562871 2.19 3.89
foreign | 74 .2972973 .4601885 0 1
.
. log close
name: <unnamed>
log: /home/enzmann/test_2pdf.smcl
log type: smcl
closed on: 4 Nov 2024, 01:38:18
--------------------------------------------------------------------------------------------------------------------------------------------
.
. // Create .pdf-file from log file (.smcl):
. translator set smcl2pdf pagesize A4
. translator set smcl2pdf lmargin 0.586
. translator set smcl2pdf rmargin 0.586
. translator set smcl2pdf tmargin 0.586
. translator set smcl2pdf bmargin 0.586
. translator set smcl2pdf fontsize 8
. translator set smcl2pdf cmdnumber off
. translator set smcl2pdf cust1_result_color 0 0 139 // This should turn the results color to blue
. translator set smcl2pdf cust2_result_color 0 0 139 // This should turn the results color to blue
. translator set smcl2pdf headertext "test_2pdf.do"
. translator query smcl2pdf
-------------------------------------------------------------------------
header | on
headertext | test_2pdf.do
logo | on
user |
projecttext |
cmdnumber | off
addfonts |
autofont | on
-----------------------+-------------------------------------------------
fontsize | 8 lmargin | 0.59
pagesize | A4 rmargin | 0.59
pagewidth | 8.27 tmargin | 0.59
pageheight | 11.69 bmargin | 0.59
-----------------------+-------------------------------------------------
scheme | color
-----------------------+-------------------------------------------------
cust1_result_color | 0 0 139 cust2_result_color | 0 0 139
cust1_standard_color | 0 0 0 cust2_standard_color | 0 0 0
cust1_error_color | 0 0 0 cust2_error_color | 255 0 0
cust1_input_color | 0 0 0 cust2_input_color | 0 0 0
cust1_link_color | 0 0 0 cust2_link_color | 0 0 255
cust1_hilite_color | 0 0 0 cust2_hilite_color | 0 0 0
cust1_result_bold | on cust2_result_bold | on
cust1_standard_bold | off cust2_standard_bold | off
cust1_error_bold | on cust2_error_bold | on
cust1_input_bold | off cust2_input_bold | off
cust1_link_bold | off cust2_link_bold | off
cust1_hilite_bold | on cust2_hilite_bold | on
cust1_link_underline | on cust2_link_underline | on
cust1_hilite_underline | off cust2_hilite_underline | off
-------------------------------------------------------------------------
.
. translate "test_2pdf.smcl" "test_2pdf.pdf", translator(smcl2pdf)
file test_2pdf.pdf saved as PDF format

Comment