All right, so in this lecture, we are actually going to talk about generating a PDF file using playwrite,
I mean, that is going to be even more similar, like how we it over here.
So I'm just going to copy paste this code on a new file called this as PDF dot, just like that on a
page it over here.
And instead of this record video, probably just get rid of it because I'm going to do that.
We are going to make use of the PDF operation.
So the PDF operation is also quite interesting and it's much, much easier to do.
The only thing that you need to probably take care is to remove this headless option, because if you
have the hatful option, the public option is not going to work.
That's something that you need to take in and probably show you what I really mean.
So the PDF of operation is like you're going to take a screen shot, like you're going to make this
picture dumb as a PDF and then you're going to see how it actually looks like.
It's pretty much like how you're going to use it for reporting purposes and things of that nature.
So all I'm going to do is use the page option.
So the PDF is available on the page level and then just create a PDF and then you have to specify the
path over here.
So if I just a part, you can see that the part comes in and then you can do something like a full page
doc pdf or something like that.
I'm going to save this.
And if I tried to run the normal PDF Dargis and if I had to enter.
You can see that it comes in.
And it didn't really work.
Basically, it gives me an error message here, saying the protocol error Pasdar print to preserve is
not implemented, it doesn't really make any sense because at the moment you can actually do a control
P Command P on Mac and you can see that the print option is coming in.
But for some reason, this guy is telling me that the print UPDF is not implemented.
The reason being the browser is actually in a hurtful mode.
So you can probably turn this thing off like from headless to hateful.
And if you try to run this project out just once again, hopefully this time it will work.
So this is the way that you can actually generate PDF file.
And for some reason why, oh, sorry, it's not being staged, I can see that it actually is had headless
mode and the full page, I believe it's generated, you can actually open this in find our full page,
our PDF, and you can see that the PDF is actually coming.
The most important thing not to note in here is that if there is any you all you can see that the you
are actually navigator on this particular file.
And if you go to the create new music that the year Abda Sami Larcombe employed create is actually coming.
So if you click this guy, it is actually going to take you to the employees create page as well.
So this is like a PDF with all the anchor tag embedded in it.
So this is something you need to note as well.
So this is what is this generation is going to look like?
I mean, there are some other options that you can take a full page video if you can remove the headers
and footers and all those things.
You can do that.
If you just put a camera there and you can see that there are so many different properties comes in,
you can just play around with it and you can see like what else you can do and stuff.
I mean, those are pretty basic.
Just it's like a command extra property that you're going to be using and you can keep extending this
as much you can.