tag:support.markedapp.com,2011-09-11:/discussions/questions/8998-exporting-code-to-pdfMarked: Discussion 2017-08-22T20:52:01Ztag:support.markedapp.com,2011-09-11:Comment/432639702017-08-22T18:15:41Z2017-08-22T18:15:43ZExporting code to PDF<div><p>I currently use Google Docs to make computer system troubleshooting guides. I've utilized one of the heading presets (Heading 4) as my code syntax, which converts the font to a fixed-width font and so on. I "beautified" my code through an external plugin that changed the colors, bold, and italicized.</p>
<p>When I would export this to a PDF for sending to the customer, very long lines like this would word wrap, causing newlines. When you copy/paste this into terminal, the first line before the word wrap would attempt to execute, creating chaos for the next several lines.</p>
<p>ls 103.odt 103.pdf 104.odt 104.pdf 105.odt 105.pdf 106.odt 106.pdf 107.odt 107.pdf 108a.odt 108.odt 108.pdf 109.odt 109.pdf 110b.odt 110.odt 110.pdf 111.odt 111.pdf 112.odt 112.pdf 113.odt linux-headers-3.16.0-customkernel_1_amd64.deb linux-image-3.16.0-customkernel_1_amd64.deb network.jpeg && printf "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"</p>
<p>Furthermore, I had to stop "beautifying" my code syntax because the colors and bolds and other changes cause unwanted whitespaces when exported to PDF.</p>
<p>What I want to know is, are these problems with Google Docs or PDF exports? I want to use this program if I can start efficiently putting very long lines of code in an easily copy//paste format for users in a PDF document.</p></div>Steventag:support.markedapp.com,2011-09-11:Comment/432639702017-08-22T19:06:47Z2017-08-22T19:06:47ZExporting code to PDF<div><p>This is most likely a Google Docs problem. Google Docs isn't a plain<br>
text editor, it works with an XML-based rich text. Only converting it to<br>
plain text will allow processing through Markdown apps, and it doesn't<br>
make that terribly easy without giving up ALL styling.</p>
<p>My suggestion would be to not work in Google Docs if you want to export<br>
through Marked. If you need the collaborative aspects, you can use<br>
Quip.com, which has built-in Markdown export for documentation. Might be<br>
worth looking into.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/432639702017-08-22T19:09:26Z2017-08-22T19:09:26ZExporting code to PDF<div><p>Oh, and specifically regarding code, the PDF format in general is likely<br>
going to cause issues with anything it sees as a line break (or soft<br>
wrap) when copying. The best bet would be to use the \ continue syntax<br>
for shells like bash, and wrap the lines at less than page width, e.g.:</p>
<pre>
<code>ls 103.odt 103.pdf 104.odt 104.pdf 105.odt 105.pdf 106.odt \
106.pdf 107.odt 107.pdf 108a.odt 108.odt 108.pdf 109.odt 109.pdf \
110b.odt 110.odt 110.pdf 111.odt 111.pdf 112.odt 112.pdf 113.odt \
linux-headers-3.16.0-customkernel_1_amd64.deb \
linux-image-3.16.0-customkernel_1_amd64.deb \
network.jpeg && printf "blah blah blah blah blah blah blah blah \
blah blah blah blah blah blah blah blah blah blah"</code>
</pre>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/432639702017-08-22T19:28:32Z2017-08-22T19:28:33ZExporting code to PDF<div><p>Thanks Brett. I took a random StackOverflow post that had a code sample here (the question): <a href="https://stackoverflow.com/questions/45825421/c-sharp-net-and-win2012-firewall">https://stackoverflow.com/questions/45825421/c-sharp-net-and-win201...</a></p>
<p>This format-preserved output window, whether Windows Shell, C++, Python, Bash, etc... is probably NOT able to be reproduced through PDF, correct? I am now starting to realize why so many software products provide their 'Help' documents in HTML format.</p>
<p>If this becomes my case and I decide to start providing my guides in HTML format, would Marked help me accomplish these windows with preserved formatting?</p></div>Steventag:support.markedapp.com,2011-09-11:Comment/432639702017-08-22T20:52:00Z2017-08-22T20:52:00ZExporting code to PDF<div><p>You'd run into the same issues, I believe. If you're on a Mac, yes,<br>
Marked can help. I use Marked to generate a lot of my documentation in<br>
both HTML and PDF formats.</p>
<p>-Brett</p></div>Brett