%% Extract Text Data from PDF
% Extract the text from exampleSonnets.pdf using extractFileText. The file exampleSonnets.pdf contains Shakespeare's sonnets in a PDF file.

str = extractFileText("exampleSonnets.pdf");

% View the second sonnet.

ii = strfind(str,"II");
iii = strfind(str,"III");
start = ii(1);
fin = iii(1);
extractBetween(str,start,fin-1)

%
% Extract the text from pages 3, 5, and 7 of the PDF file.

pages = [3 5 7];
str = extractFileText("exampleSonnets.pdf", ...
    'Pages',pages);

% View the 10th sonnet.

x = strfind(str,"X");
xi = strfind(str,"XI");
start = x(1);
fin = xi(1);
extractBetween(str,start,fin-1)

%
%