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

Theme class 'lead' and 'invert' not working when export to pdf and pptx #425

Open
foryoung365 opened this issue Jul 13, 2023 · 9 comments
Open

Comments

@foryoung365
Copy link

foryoung365 commented Jul 13, 2023

Version of Marp Tool

marp-vscode 2.6.0

Operating System

Windows

Environment

vs code about:
Version: 1.79.2 (system setup)
Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
Date: 2023-06-14T08:57:04.379Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045

How to reproduce

---
marp: true
theme: default
class: 
    - lead
    - invert
---

# Use your own theme

===========
save above as test.md, export to pdf or pptx

Expected behavior

image
work like preview

Actual behavior

image

Additional information

No response

@foryoung365 foryoung365 added the bug Something isn't working label Jul 13, 2023
@yhatt yhatt added need more info and removed bug Something isn't working labels Jul 13, 2023
@yhatt
Copy link
Member

yhatt commented Jul 13, 2023

I could not reproduce that. A provided Markdown exports the correct output with inverted color scheme, just like this PDF.
(Note: lead class is not supported in default theme, and it is only available in gaia theme)

We need more information to debug. e.g. the output of console in the VS Code's developer tools while exporting

@foryoung365
Copy link
Author

foryoung365 commented Jul 14, 2023

image

here is the output of the dev tools, but it seems eveything is ok.

test.pdf

I also upload the output pdf file, hope this will help.
If any other debug info needed, please let me know.

@foryoung365
Copy link
Author

foryoung365 commented Jul 14, 2023

I tried upgrade node.js to v18.16.1, and use marp-cli to convert to pptx directly, and it doesn't work neither.
image
test.pptx

@yhatt
Copy link
Member

yhatt commented Aug 2, 2023

How about if specified just a string as class, instead of YAML array?

---
marp: true
theme: default
class: invert
---

# Use your own theme

This expects exactly same result as YAML array version.

@foryoung365
Copy link
Author

How about if specified just a string as class, instead of YAML array?

---
marp: true
theme: default
class: invert
---

# Use your own theme

This expects exactly same result as YAML array version.

I have tried this, but it don't work either.
And I also tried exporting to every format marp supported, all of them produce the incorrect result except html.

@yhatt
Copy link
Member

yhatt commented Aug 9, 2023

Please check whether installing the latest version of Google Chrome. If not, try to export after updating Chrome into 115.

If you had installed very old version of Chrome, slide variants by class might not work while exporting PDF, due to unsupported modern CSS (:where selector is supported in Chrome 88 and later).

@foryoung365
Copy link
Author

image

chrome version is 115.0.5790.170.

@yhatt
Copy link
Member

yhatt commented Aug 10, 2023

If you were using Chrome Enterprise, some features for printing PDF correctly might be restricted by the enterprise policy. For example, if PrintingAllowedBackgroundGraphicsModes policy is set as "disabled", PDF may not reproduce the expected color in the slide.

You can check whether managed by the enterprise in chrome://management, and can peek the current policy in chrome://policy. You may have to request to change policy into your administrator as needed.

@foryoung365
Copy link
Author

image

It seems like there is no activated policy in chrome://policy/.

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

No branches or pull requests

2 participants