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

Exporting a Note to PDF Does Not Apply userstyle.css #2324

Closed
dpoulton-github opened this issue Jan 20, 2020 · 11 comments
Closed

Exporting a Note to PDF Does Not Apply userstyle.css #2324

dpoulton-github opened this issue Jan 20, 2020 · 11 comments
Labels
bug It's a bug desktop All desktop platforms

Comments

@dpoulton-github
Copy link

As raised in the forum

Environment

Joplin version: 1.0.178
Platform: Windows 10 (1909) x64
Platform: Linux (Mint 19.3) x64

Steps To Reproduce

  1. Place a custom userstyle.css with specific settings for print output into the relevant joplin-desktop folder.
  2. Select a note.
  3. Right-click the note and export as PDF (unable to check using the main menu export option due to bug #2322)
  4. Open PDF - Note presented in PDF format but NOT formatted as per any settings in userstyle.css

Describe what you expected to happen:

The note styles should be modified by userstyle.css and this should be reflected in the PDF output.

Note: Prior to an upgrade from 1.0.175 to 1.0.178 the custom stylesheet used when discovering this issue worked and had not been modified since.

@miciasto
Copy link
Contributor

Thanks @dpoulton-github -- can you supply a minimal example of print css that fails?

@dpoulton-github
Copy link
Author

This is an extract from my userstyle.css

@media print {
	blockquote {
        border-left: 4px solid #000000; /* black quote border for printing */
        opacity: 1; /* darkens text from default of .7 for printing */
	}

	code {
        font-size: 12px;
        color: #000000;
        font-weight: bold; /* bold code text for printing */
	}

	.inline-code {
        font-size: 12px;
        color: #000000;
        border: 0px none; /* removes inline code border for printing */
        background: none; /* removes inline code background  for printing */
        font-weight: bold; /* bold code text for printing */
	}
}

@miciasto
Copy link
Contributor

1.0.178 -- confirmed broken
1.0.177 -- confirmed broken
1.0.176 -- not tested
1.0.175 -- confirmed working

on Ubuntu Linux

@dpoulton-github
Copy link
Author

@mic704b
Thanks for confirming.
As a contributor would it be possible for you to label this as a "bug"?
Wouldn't want this issue to get missed.

@tessus tessus added bug It's a bug desktop All desktop platforms labels Jan 22, 2020
@tessus
Copy link
Collaborator

tessus commented Jan 22, 2020

@laurent22 this was tested a while back. Is it possible that this has anything to do with the new renderer?

@laurent22
Copy link
Owner

Yes, this or the Electron update

@deciacco
Copy link

For what it's worth...

Not working for me either. v1.0.178 (prod, win32) Windows 10.

PDF does not have expected page breaks.

This is my note:

# H1

## H2
- test
- test2

## H2
- test3
- test4

# H1

## H2
- test5

This is my userstyle.css:

@media print, (overflow-block: paged) or (overflow-block: optional-paged)
{
  /* Move top-level headings to a new page on the right-hand side: */
  h1
  {
    page-break-before: right; /* CSS 2 */
    break-before: recto;      /* CSS 3+, 
      also works for languages written and paginated right-to-left */
  }
  /* Override the previous ruleset for the very first heading: */
  h1:first-of-type,
  section > h1:first-child
  {
    page-break-before: avoid; /* CSS 2 */
    break-before: avoid;      /* CSS 3+ */
  }
  /* Force second-level headings to begin in a new column or
     possiblyon a new page if it was in the last of multiple columns otherwise: */
  h2
  {
    break-before: column;
  }
  /* Headings should not be the last paragraph on a page: */
  h1, h2, h3, h4, h5, h6
  {
    page-break-after: avoid;
  }
  /* Consecutive headings with deepening level should not be split across pages: */
  h1+h2, h2+h3, h3+h4, h4+h5, h5+h6
  {
    page-break-before: avoid;
  }
}

@razlupercio
Copy link

fwiwi

the pdf export function neither works on OSx 10.15.2 (Catalina) my Joplin version is 1.0.178

@miciasto
Copy link
Contributor

the pdf export function neither works on OSx 10.15.2 (Catalina) my Joplin version is 1.0.178

@razlupercio see #2322

@tessus
Copy link
Collaborator

tessus commented Jan 23, 2020

@mic704b #2322 fixes empty pdf files when exporting. This issue is about export not honoring the userstyle.css.

@deciacco
Copy link

works!! thank you! really appreciate it!

@lock lock bot locked and limited conversation to collaborators Feb 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug It's a bug desktop All desktop platforms
Projects
None yet
Development

No branches or pull requests

6 participants