Last change
on this file since 39012 was 32205, checked in by ak19, 6 years ago |
First set of commits to do with implementing the new 'paged_html' output option of PDFPlugin that uses using xpdftools' new pdftohtml. So far tested only on Linux (64 bit), but things work there so I'm optimistically committing the changes since they work. 2. Committing the pre-built Linux binaries of XPDFtools for both 32 and 64 bit built by the XPDF group. 2. To use the correct bitness variant of xpdftools, setup.bash now exports the BITNESS env var, consulted by gsConvert.pl. 3. All the perl code changes to do with using xpdf tools' pdftohtml to generate paged_html and feed it in the desired form into GS(3): gsConvert.pl, PDFPlugin.pm and its parent ConvertBinaryPFile.pm have been modified to make it all work. xpdftools' pdftohtml generates a folder containing an html file and a screenshot for each page in a PDF (as well as an index.html linking to each page's html). However, we want a single html file that contains each individual 'page' html's content in a div, and need to do some further HTML style, attribute and structure modifications to massage the xpdftool output to what we want for GS. In order to parse and manipulate the HTML 'DOM' to do this, we're using the Mojo::DOM package that Dr Bainbridge found and which he's compiled up. Mojo::DOM is therefore also committed in this revision. Some further changes and some display fixes are required, but need to check with the others about that.
|
File size:
1.6 KB
|
Line | |
---|
1 | package Mojo::Cookie;
|
---|
2 | use Mojo::Base -base;
|
---|
3 | use overload bool => sub {1}, '""' => sub { shift->to_string }, fallback => 1;
|
---|
4 |
|
---|
5 | use Carp 'croak';
|
---|
6 |
|
---|
7 | has [qw(name value)];
|
---|
8 |
|
---|
9 | sub parse { croak 'Method "parse" not implemented by subclass' }
|
---|
10 | sub to_string { croak 'Method "to_string" not implemented by subclass' }
|
---|
11 |
|
---|
12 | 1;
|
---|
13 |
|
---|
14 | =encoding utf8
|
---|
15 |
|
---|
16 | =head1 NAME
|
---|
17 |
|
---|
18 | Mojo::Cookie - HTTP cookie base class
|
---|
19 |
|
---|
20 | =head1 SYNOPSIS
|
---|
21 |
|
---|
22 | package Mojo::Cookie::MyCookie;
|
---|
23 | use Mojo::Base 'Mojo::Cookie';
|
---|
24 |
|
---|
25 | sub parse {...}
|
---|
26 | sub to_string {...}
|
---|
27 |
|
---|
28 | =head1 DESCRIPTION
|
---|
29 |
|
---|
30 | L<Mojo::Cookie> is an abstract base class for HTTP cookie containers, based on
|
---|
31 | L<RFC 6265|http://tools.ietf.org/html/rfc6265>, like L<Mojo::Cookie::Request>
|
---|
32 | and L<Mojo::Cookie::Response>.
|
---|
33 |
|
---|
34 | =head1 ATTRIBUTES
|
---|
35 |
|
---|
36 | L<Mojo::Cookie> implements the following attributes.
|
---|
37 |
|
---|
38 | =head2 name
|
---|
39 |
|
---|
40 | my $name = $cookie->name;
|
---|
41 | $cookie = $cookie->name('foo');
|
---|
42 |
|
---|
43 | Cookie name.
|
---|
44 |
|
---|
45 | =head2 value
|
---|
46 |
|
---|
47 | my $value = $cookie->value;
|
---|
48 | $cookie = $cookie->value('/test');
|
---|
49 |
|
---|
50 | Cookie value.
|
---|
51 |
|
---|
52 | =head1 METHODS
|
---|
53 |
|
---|
54 | L<Mojo::Cookie> inherits all methods from L<Mojo::Base> and implements the
|
---|
55 | following new ones.
|
---|
56 |
|
---|
57 | =head2 parse
|
---|
58 |
|
---|
59 | my $cookies = $cookie->parse($str);
|
---|
60 |
|
---|
61 | Parse cookies. Meant to be overloaded in a subclass.
|
---|
62 |
|
---|
63 | =head2 to_string
|
---|
64 |
|
---|
65 | my $str = $cookie->to_string;
|
---|
66 |
|
---|
67 | Render cookie. Meant to be overloaded in a subclass.
|
---|
68 |
|
---|
69 | =head1 OPERATORS
|
---|
70 |
|
---|
71 | L<Mojo::Cookie> overloads the following operators.
|
---|
72 |
|
---|
73 | =head2 bool
|
---|
74 |
|
---|
75 | my $bool = !!$cookie;
|
---|
76 |
|
---|
77 | Always true.
|
---|
78 |
|
---|
79 | =head2 stringify
|
---|
80 |
|
---|
81 | my $str = "$cookie";
|
---|
82 |
|
---|
83 | Alias for L</"to_string">.
|
---|
84 |
|
---|
85 | =head1 SEE ALSO
|
---|
86 |
|
---|
87 | L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
|
---|
88 |
|
---|
89 | =cut
|
---|
Note:
See
TracBrowser
for help on using the repository browser.