How to Export All Source Code to PDF Document & Print it in VSCode IDE
5 views
Jul 9, 2025
Get the full source code of application here:
View Video Transcript
0:00
Uh hello guys, welcome to this video. So
0:02
in this video, I'll show you a VS code
0:05
extension which allows you to directly
0:08
export all your source code to a PDF
0:11
document or you can directly print it
0:14
directly inside VS code. So it will add
0:16
a button. So for installing this
0:18
extension just go to the extensions tab
0:20
and just write here in the search bar
0:22
print
0:24
and uh as soon as you write this the
0:26
second extension which comes by the name
0:28
of print you will see this is the
0:31
extension and it's used by almost
0:34
530,000 developers and what this
0:37
extension do it actually adds a button
0:40
right here side by side in the editor
0:42
itself. So just need to click the
0:44
install button and as soon as you
0:46
install it you need to go to your source
0:50
code. So this is actually a file here
0:52
and right here you will see this button
0:55
added right here which is of the print
0:57
button.
0:59
So if you just click this button so what
1:02
this will do it will actually open a
1:04
page in the browser directly and this
1:07
print window will open directly right
1:09
here. So from here if you have a printer
1:13
you can directly print your source code
1:16
or if you just want to save it as a PDF
1:18
file simply select from a drop-down here
1:21
select as PDF and you can select all
1:23
pages or you can even say custom pages
1:26
as well and you can select the layout
1:29
here portrait or landscape.
1:32
You can see that. And then more
1:34
settings. You can even say paper size,
1:36
you can control it, everything.
1:39
And click on save. And then it will ask
1:41
you the location where to save it.
1:43
Simply select.
1:46
After that, you will see your file has
1:49
been successfully saved. And as you can
1:52
see, it also tells you the date and the
1:54
time. This is a file name index.php. And
1:57
you can see with uh very good syntax
2:00
highlighting with line numbers all your
2:02
PDF is constructed here. And you can see
2:05
all your source code. This is a simple
2:08
PHP file, Laravel code here. And with
2:12
one click you can actually export your
2:14
all your code inside your VS code file
2:17
into a PDF document. So it's a very
2:19
useful extension. So you can go to any
2:22
file here which you want to export this.
2:24
Sometimes you do want to share the
2:26
source code and then again you will see
2:29
for for every file here you have this
2:31
button here. So simply you need to click
2:33
this button and once you click it you
2:36
will see this window will appear and you
2:38
will be able to save this code directly
2:40
to PDF and click on save here. You will
2:42
see the code will be saved with this
2:44
name here. So you see
2:48
the code is successfully saved here. So
2:51
if the code is larger here as you can
2:53
see in this case it basically splits
2:55
across multiple pages here. It
2:57
calculates how many pages are required.
2:59
So in this case it created four pages in
3:01
the PDF document. So it can handle much
3:05
larger code as well. So you can see
3:07
that. So it's a must-have extension. So
3:10
simply go to extensions install this
3:13
extension. It's totally free and it will
3:16
save you a lot of time as well. So you
3:18
can see that and one more thing you can
3:21
even do if you only want to
3:24
let's suppose only a part of the code
3:26
you can select the code here that you
3:30
want to export
3:33
and then click on
3:35
right click it and then say print. So
3:38
this will only export the code that you
3:40
selected not the full file. So you can
3:42
even do that as well. Simply select the
3:44
code that you want to export to PDF and
3:47
just right click and this option is
3:49
added in the context menu. You will see
3:51
print option is added. So right click
3:53
print and you will be able to export
3:56
only the code that you select. So this
3:58
is a extension that you should have
4:01
simply install this extension in VS code
4:04
which will export your code to PDF. Uh
4:07
also check out my website
4:08
freemediattools.com
4:10
uh which contains thousands of tools.