uh hello guys uh welcome to this video
So in this video I will show you uh how
to convert your XML and uh
uh XML and JSON file into
PDF So
uh inside Python So for this we have
actually a dependency that you need to
install Uh the dependency name is PDF it
down So this is actually the command
here Simply install this by executing
this pip command I've already installed
it And uh after installing it uh you
just need to create a simple users file
So you can see both the JSON and XML
file are there in my working directory
And inside this user JSON file you see
an array of object Each object has some
properties and same we have this XML
file as well So now we we will look at
how to convert both these files to PDF
So just create a simple app py file So
the result will look something like this
You can see this is your JSON file
successfully converted to PDF And same
goes with this as well This is your XML
data converted to PDF So now let me show
you how to actually write
this So just create a simple app py file
and
uh after that first of all you need to
import the package So we simply say from
PDF it down it contains this function
PDF
conversion and from this you need to
import this PDF
conversion Sorry not PDF conversion
There is a method here which you need to
import which is converter After that uh
you just need to initialize this
converter like this After initializing
this converter it has some a series of
methods So one such method is this
convert method It takes two arguments
First of all your file
path So here you will
specify your JSON file and then it takes
the second argument which is your output
path So this will be the PDF file which
get created Same we will do this for XML
as well
So here you will replace your XML file
and
then so as soon as you execute this
application on the left hand side you
will see these two files will get
created the JSON and XML file will get
converted to
PDF So you will see both the files have
been created So in this easy way you can
use this Python package to carry out the
conversion from JSON to PDF and XML to
PDF So you'll see all the JSON data has
been successfully inserted to the PDF
document and same is your XML data as
well So this was the XML file and this
is your PDF file So uh you can use this
package very important package inside
Python Uh thank you very much for
watching this video and also check out
my website freemediattools.com
uh which contains thousands of tools