1
00:00:00,150 --> 00:00:06,330
All right, so in this lecture, we are actually going to talk about generating a PDF file using playwrite,

2
00:00:06,390 --> 00:00:09,500
I mean, that is going to be even more similar, like how we it over here.

3
00:00:09,540 --> 00:00:17,250
So I'm just going to copy paste this code on a new file called this as PDF dot, just like that on a

4
00:00:17,250 --> 00:00:18,060
page it over here.

5
00:00:18,330 --> 00:00:23,220
And instead of this record video, probably just get rid of it because I'm going to do that.

6
00:00:23,610 --> 00:00:26,760
We are going to make use of the PDF operation.

7
00:00:27,040 --> 00:00:32,130
So the PDF operation is also quite interesting and it's much, much easier to do.

8
00:00:32,320 --> 00:00:36,690
The only thing that you need to probably take care is to remove this headless option, because if you

9
00:00:36,690 --> 00:00:40,110
have the hatful option, the public option is not going to work.

10
00:00:40,140 --> 00:00:43,490
That's something that you need to take in and probably show you what I really mean.

11
00:00:43,950 --> 00:00:48,420
So the PDF of operation is like you're going to take a screen shot, like you're going to make this

12
00:00:48,420 --> 00:00:52,830
picture dumb as a PDF and then you're going to see how it actually looks like.

13
00:00:52,980 --> 00:00:56,460
It's pretty much like how you're going to use it for reporting purposes and things of that nature.

14
00:00:56,910 --> 00:00:59,640
So all I'm going to do is use the page option.

15
00:00:59,640 --> 00:01:05,760
So the PDF is available on the page level and then just create a PDF and then you have to specify the

16
00:01:05,760 --> 00:01:06,790
path over here.

17
00:01:06,810 --> 00:01:15,540
So if I just a part, you can see that the part comes in and then you can do something like a full page

18
00:01:16,860 --> 00:01:18,810
doc pdf or something like that.

19
00:01:20,040 --> 00:01:21,000
I'm going to save this.

20
00:01:21,000 --> 00:01:26,550
And if I tried to run the normal PDF Dargis and if I had to enter.

21
00:01:28,520 --> 00:01:30,140
You can see that it comes in.

22
00:01:31,610 --> 00:01:33,080
And it didn't really work.

23
00:01:33,150 --> 00:01:38,750
Basically, it gives me an error message here, saying the protocol error Pasdar print to preserve is

24
00:01:38,750 --> 00:01:44,840
not implemented, it doesn't really make any sense because at the moment you can actually do a control

25
00:01:44,840 --> 00:01:49,510
P Command P on Mac and you can see that the print option is coming in.

26
00:01:49,520 --> 00:01:55,290
But for some reason, this guy is telling me that the print UPDF is not implemented.

27
00:01:55,910 --> 00:01:58,700
The reason being the browser is actually in a hurtful mode.

28
00:01:58,730 --> 00:02:03,290
So you can probably turn this thing off like from headless to hateful.

29
00:02:03,620 --> 00:02:09,380
And if you try to run this project out just once again, hopefully this time it will work.

30
00:02:09,410 --> 00:02:12,830
So this is the way that you can actually generate PDF file.

31
00:02:14,570 --> 00:02:20,690
And for some reason why, oh, sorry, it's not being staged, I can see that it actually is had headless

32
00:02:20,690 --> 00:02:30,150
mode and the full page, I believe it's generated, you can actually open this in find our full page,

33
00:02:30,150 --> 00:02:34,280
our PDF, and you can see that the PDF is actually coming.

34
00:02:34,850 --> 00:02:40,370
The most important thing not to note in here is that if there is any you all you can see that the you

35
00:02:40,370 --> 00:02:43,280
are actually navigator on this particular file.

36
00:02:43,610 --> 00:02:49,930
And if you go to the create new music that the year Abda Sami Larcombe employed create is actually coming.

37
00:02:49,940 --> 00:02:56,270
So if you click this guy, it is actually going to take you to the employees create page as well.

38
00:02:56,300 --> 00:03:01,540
So this is like a PDF with all the anchor tag embedded in it.

39
00:03:01,550 --> 00:03:03,800
So this is something you need to note as well.

40
00:03:04,100 --> 00:03:07,700
So this is what is this generation is going to look like?

41
00:03:07,730 --> 00:03:11,900
I mean, there are some other options that you can take a full page video if you can remove the headers

42
00:03:11,900 --> 00:03:13,130
and footers and all those things.

43
00:03:13,340 --> 00:03:14,240
You can do that.

44
00:03:14,810 --> 00:03:20,030
If you just put a camera there and you can see that there are so many different properties comes in,

45
00:03:20,300 --> 00:03:25,000
you can just play around with it and you can see like what else you can do and stuff.

46
00:03:25,010 --> 00:03:26,780
I mean, those are pretty basic.

47
00:03:26,780 --> 00:03:31,760
Just it's like a command extra property that you're going to be using and you can keep extending this

48
00:03:31,760 --> 00:03:32,720
as much you can.
