vivin / pdfjs-text-selection-demo

A minimal example that shows you how to render a PDF document and enable text-selection.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using a viewer

shahzain-blur opened this issue · comments

Hi,

I like this code and thank you for making it. I just have one problem. I want to use the PDFjs viewer as shown on their demo page to show the PDF. How can I integrate that with a base64 encoded data?

Thank you.

You will have to take a look at their code. You can pretty much hardcode
the base64 data or retrieve it from elsewhere (like via AJAX). Then you'll
have to convert it into a uint8array like I have in my code. This example I
have is actually dated. You probably want to take a look at the demo I
committed to the examples directory in mozilla/pdf.js. You can see it here:
https://github.com/mozilla/pdf.js/tree/master/examples/text-selection

On Wed, Oct 9, 2013 at 3:18 AM, Shahzain Badruddin <notifications@github.com

wrote:

Hi,

I like this code and thank you for making it. I just have one problem. I
want to use the PDFjs viewer as shown on their demo page to show the PDF.
How can I integrate that with a base64 encoded data?

Thank you.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.

Ruin untold;
And thine own sadness,
Sing in the grass,
When eve has forgot, that no more hear common things that gleam and pass;
But seek alone to lip, sad Rose of love and ruin untold;
And thine own mother
Can know it as I know
More than another
What makes your own sadness,
Set in her eyes.

$s="01:11:02:11:01:11:02:13:01:11:01:11:01:13:02:12:01:13:01:11:
04:11:06:12:04:11:01:12:01:13:02:12:01:14:01:13:01:11:03:12:
01:11:04:12:02:11:01:11:01:13:02:11:03:11:06:11:01:11:05:12:
02:11:01:11:01:13:02:11:02:12:01:12:04:11:06:12:01:11:04:12:
04:11:01:12:03:12:01:12:01:11:01:12:01:12:02:11:01:11:01:13:
02:11:01:02:11:01:12:02";
@A=split(/:/,$s);$j="";foreach$c(@A) {@n=split(//,$c);$j.=$n[0]x$n[1];}
for($i=0;$i<$j=~y///c;$i+=8){print
chr(unpack("N",pack("B32",substr("0"x32 .substr($j,$i,8),-32))));}