# How do students create a pdf of their code?

**URL:** <https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033>\
**Category:** Unit and Lesson Discussion\
**Tags:** csp-unit-3, csp-unit-3-lesson-10\
**Created:** [November 11, 2018, 4:15pm UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033 "2018-11-11T16:15:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![changa.imara](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@changa.imara](https://forum.code.org/u/changa.imara)\
**Post date:** [November 11, 2018, 4:15pm UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033/1 "2018-11-11T16:15:20Z")

</div>

I suppose I can just have them drop their code into a google doc but are there any easy tools for creating syntax highlighted, pretty printed, PDFs of JavaScript source code?

---

<div class="post-metadata">

**Author:** ![jhall9](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jhall9](https://forum.code.org/u/jhall9)\
**Post date:** [November 13, 2018, 2:19am UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033/2 "2018-11-13T02:19:06Z")

</div>

From the lesson plan…

1. Have students copy their code into [CodePrint](https://bakerfranke.github.io/codePrint/), draw a rectangle around the abstraction they are writing about, and then print/save that as a PDF

Hope that helps!

---

<div class="post-metadata">

**Author:** ![gjschmidt](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/gjschmidt/32/4922_2.png) [@gjschmidt](https://forum.code.org/u/gjschmidt)\
**Post date:** [November 13, 2018, 2:43am UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033/3 "2018-11-13T02:43:30Z")

</div>

Code Print is great. Copying the code and pasting into Word is another option. If you do that it looks better if the font is Courier New or another fixed width font.

---

<div class="post-metadata">

**Author:** ![droberts](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@droberts](https://forum.code.org/u/droberts)\
**Post date:** [December 6, 2018, 11:05am UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033/4 "2018-12-06T11:05:12Z")

</div>

When we go to CodePrint, there is only an option to print. There is no option to save as a PDF. What am I missing?

---

<div class="post-metadata">

**Author:** ![baker](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/baker/32/1229_2.png) [@baker](https://forum.code.org/u/baker)\
**Post date:** [December 7, 2018, 3:44pm UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033/5 "2018-12-07T15:44:57Z")

</div>

Hi,

So-called “Print to PDF” is a pretty common feature of modern operating systems that the CodePrint tool is assuming you’ll use. Most computers have “save as PDF” or “print to PDF” as part of the built-in print dialog.

If you search for “print to pdf \_\_\_\_\_” and fill in the blank with “windows,” “mac”, etc. you should find what you need.

For example, here’s a windows one: [https://www.digitaltrends.com/computing/print-pdf-windows/](https://www.digitaltrends.com/computing/print-pdf-windows/) (But I didn’t search that hard)

Hope that helps,

–Baker

---

<div class="post-metadata">

**Author:** ![myang](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@myang](https://forum.code.org/u/myang)\
**Post date:** [April 27, 2023, 7:03pm UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033/6 "2023-04-27T19:03:26Z")

</div>

On CodePrint, when the code is longer than one page the line numbers don’t print on the first page. Has anyone found a workaround for this?

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [April 27, 2023, 7:31pm UTC](https://forum.code.org/t/how-do-students-create-a-pdf-of-their-code/22033/7 "2023-04-27T19:31:29Z")

</div>

There is some discussion about this in [this](https://forum.code.org/t/create-pt-code-print/37786) thread. Check it out.
