Printing indentation lines in PDF export

We strongly recommend you to search the forum with possible keywords before making a new feature request. If your request is very similar to an existing one, consider liking it and/or making a comment rather than making a new one. Once you’ve searched and determined that this is a new request, delete this line.

Use case or problem

This feature was already requested, but the thread was closed without comment. I would like to have this feature or know if the possibility exists in the meantime.

I want the bullet lines that you see in preview or edit mode to be visible in the exported PDF version as well.

in preview mode (or even in edit mode) you can see the bullet lines:

image

but not in the PDF export:

image

Proposed solution

I want the bullet lines to appear in the exported PDF

Related feature requests (optional)

Came here to look for solutions to this, but it looks like not a lot of people find this problematic. I would use it though. I tried installing the outliner plugin but that didn’t help either.

1 Like

Still no feature for this?

Created an account on the forums to comment that this is a show stopper for me. I need ways to pull notes out of Obsidian and put them into a more family-friendly sharing tool. I can’t find a way to export to any useful format, and sticking with md won’t work.

Without a reasonable workaround for interoperability, I expect Obsidian will be just for my local knowledge base and not a replacement for other general note taking apps.

1 Like

The following works for my formatting, though some values may need adjustments to match yours, or the default. (e.g. top: may be 1em)

/* PDF Exports - Indentation Lines */
@media print {
    li > ul::before,
    li > ol::before {
        content: "\200B";
        position: absolute;
        display: block;
        left: var(--ig-adjust-reading);
        top: 1.5em;
        bottom: 0;
        border-right: var(--indentation-guide-width) solid var(--indentation-guide-color);
    }
}

If you’re ever looking to re-implement another feature missing from PDF exports, here’s how I found and wrote a CSS snippet for the one above:

  1. Open an Obsidian file that contains the HTML element you’re looking for.
  2. Press shift+ctrl+i
  3. Click anywhere inside the Elements section at the top or left
  4. Press ctrl+f and search for "workspace-tab-container" (quotation marks included)
  5. Click on the found <div class="workspace-tab-container"> element.
    • Note that when you do so, most of your Obsidian page (everything under the tabs at the top) is highlighted. This indicates what that HTML element contains.
  6. Navigate down the contained HTML elements that highlight relevant parts of the page until you find the specific element you’re looking for.
  7. Below or to the right of the Elements section should be a Styles section. Somewhere in here is a sheet styling you can use as a base for a CSS snippet.
    • ctrl+f is useful here too.
    • Check out W3’s CSS guides to understand the basics of how CSS works. There’s probably 60sec introductions on YouTube as well.
    • Note that any property that is crossed out is being overridden from another selector, and so can be ignored since it isn’t being used to style the page.
      • Likewise, once you find the selector and property you want to replace in your own CSS snippet, you’ll be looking to override it. To ensure it’s prioritized over others, you may need to use an !important flag.
    • If having difficulty discerning which selector applies to the element you’re looking for, you can copy selectors into a snippet with the following property to confirm:
      selector {
          display: none !important;
      }
      
  8. In your CSS snippet, insert the selector within @media print { ... }. Save and enable the CSS snippet, and it should show up in your next PDF export.
1 Like