Print preview, save as PDF, document has borders

Grant Shipley's Avatar

Grant Shipley

07 Jan, 2013 11:55 PM

Hello:

I absolutely love marked! I am using it to create a technical book and want to output the document as PDF. I am making use of the page break comment functionality to enable page breaks when using print preview -> pdf conversion. The page breaks work wonderfully. However, I notice when I go that route that my entire document has a gray border around the edges. This border does not show up if I simply export to PDF. I would just export to PDF but that doesn't respect my breaks. :(

--

  1. Support Staff 1 Posted by Brett on 13 Jan, 2013 04:03 PM

    Brett's Avatar

    Are you using the Github theme? It includes a grey border which will show up in export. If you want to work around that, you can create a custom CSS file that removes the border and keeps the rest the same. The base stylesheets and instructions are here. Let me know if you need a hand with the CSS.

  2. 2 Posted by Grant Shipley on 14 Jan, 2013 08:24 PM

    Grant Shipley's Avatar

    Yeah, some help would be great as I have never used CSS. I see several border tags in the .css file but most seem to be applied to tables?

    I assume it may be somewhere in this block:

    @media print {

    /* print only styles. Keep it clean */
    body
    {
        overflow:auto
    }
    img, pre, blockquote, table, figure, p {
        page-break-inside: avoid
    }
    .footnotes { page-break-before: always }
    
    #wrapper
    {
        background:#fff;
        color:#303030;
        font-size:85%;
        padding:10px;
        position:relative;
        text-indent:0
    }
    

    }

  3. 3 Posted by Grant Shipley on 14 Jan, 2013 09:06 PM

    Grant Shipley's Avatar

    Ah, I think I figured it out. I downloaded the default styles and removed the border from the #wrapper and that seems to work. Am I missing anything here?

    wrapper {

    background-color: #fff;
    border: 3px solid #eee !important;
    padding: 0 30px;
    margin: 15px;
    

    }

    to

    wrapper {

    background-color: #fff;
    padding: 0 30px;
    margin: 15px;
    

    }

  4. Support Staff 4 Posted by Brett on 14 Jan, 2013 09:10 PM

    Brett's Avatar

    Nope, that's exactly right. Nice work :).

  5. 5 Posted by jamie on 01 Apr, 2014 10:47 PM

    jamie's Avatar

    I'm having a similar issue with the Marked theme for Byword (http://bywordapp.com/extras/). I don't see a colored border when the using the theme in Marked 2, but when I export to PDF there's a grey border. I want to remove the grey border in the PDF. I took a look at the CSS, but I don't see where to remove the border. Can you point me in the right direction? Also, is there a way to inspect the css that will be rendered to PDF so I can find where I need to make changes?

  6. 6 Posted by jamie on 02 Apr, 2014 02:31 AM

    jamie's Avatar

    I tried adding the following CSS to the Additional CSS box in preferences, but I still get the grey border:

    @media print {
    #wrapper {
    border: none;
    }
    }

  7. Support Staff 7 Posted by Brett on 02 Apr, 2014 01:25 PM

    Brett's Avatar

    In the @media print section, add background-color: #fff to the body
    rule.

    body {
    overflow: auto;
    background-color: #fff;
    }

    You can inspect using right-click->Inspect Element, but you can't
    specifically inspect the PDF/Print output.

    -Brett

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac