Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF Text Color #632

Open
nLz00 opened this issue Apr 5, 2024 · 4 comments
Open

PDF Text Color #632

nLz00 opened this issue Apr 5, 2024 · 4 comments

Comments

@nLz00
Copy link

nLz00 commented Apr 5, 2024

Hi,
i have problems setting up text colors.
The preview for PDF shows colored text, the actual output not.

tests in a fresh editor:

[blue]#*BLAU*# +
[yellow]#*GELB*# +
[red]*ROT*
@rahmanusta
Copy link
Member

rahmanusta commented May 8, 2024

For pdf theming you should define a asciidoctor-pdf theme and colors you want to use. Please check https://discuss.asciidoctor.org/Color-for-Text-td7509.html

@nLz00
Copy link
Author

nLz00 commented Jul 3, 2024

I really dont know how to do this. I cant find a *.yml file in which it could find place.
Further help appreciated.

@rahmanusta
Copy link
Member

Please ask on https://discuss.asciidoctor.org/ since it is Asciidoctor specific question

@life888888
Copy link

life888888 commented Aug 19, 2024

My settings cannot freely set the color for a specific WORD. I can only set it according to the defined blocks, such as Header1, Header2, Header3 and so on.

Create theme file

custom-color-theme.yml

# FOR Asciidoctor-PDF 2.x
extends: default-with-font-fallbacks

# Set the base text color
base_font_color: #333333

heading:
# Color for H1 headings
  h1_font_color: #1a73e8
# Color for H2 headings  
  h2_font_color: #1a73e8
# Color for H3 headings  
  h3_font_color: #1a73e8
# Color for links  
link:
  font_color: #0000ee
# Color for literal text or code
literal:
  font_color: #d63384

demo3.adoc

= Asciidoc Theme Custom Color Demo
:pdf-themesdir: {docdir}
:pdf-fontsdir: GEM_FONTS_DIR;
:pdf-theme: custom-color

== Test Level 2

This is a Test 2.

This is a Link https://docs.asciidoctor.org/pdf-converter/latest/theme/[Asciidoctor PDF Theming]

=== Test Level 3

This is a Test 3.

AsciidocFx open demo3.adoc

PDF -> Save
003

Show PDF Color

004

custom-color-theme.yml and demo3.adoc must be placed in the same directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants