Getting element clicked text on PDF.js - pdf

I am new to PDF.js and was trying to load a PDF and find the clicked element text from PDF. My code is as follows.
Always getting clickedElement as null here. Also not sure the item bounds logic is correct here.
https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.3.122/pdf.min.js
Thanks for the help
Ajai

Related

Extract PDF coordinates using mouse click

I want to extract the coordinates of a PDF document with the help of a mouse click. I have gone through some posts but since I'm new to this, I'm not being able to understand it properly. Also, can this be done if I render the PDF file in a web page?
You can add javascript to a pdf document. Although you only get access to a limited subset of the language.
If you only need the coordinates once (for instance when doing layout of the document), you can simply open it with adobe and activate the rulers/grid option to see where your mousepointer is currently located.

Print CSS with pdf included in page

I have a page where I have a lot of info about an item, with a little "Download specs pdf" button below. Clicking it opens the pdf seperately, which is all I need for the webversion.
However I'm currently working on my print css, and my goal is to create a print css here that shows the info along with the pdf below it, included in the same printfile.
Is it possible to embed the pdf in my page (only for print css)? I've tried using the <object> or embed tags but this doesn't seem to show up at all in my print css.
Update: I managed to show the pdf using iframe, but I'm unable to set the iframe height to the pdf's height. The pdf is dynamic so it's not a set height. Dynamically updating the height through jQuery has proven to be impossible because the onload event isn't fired for file downloads in an iframe. If anyone can help me come to a solution, I would be very grateful.
Thanks in advance.
The simple solution is to force a 4:3 perspective on the iframe and size it according to your print page (A4 paper size is standard here).
You can use PDF.js library's who is an amaZing JavaScript PDF viewer working cross browser. Display the PDF in a div, make it hidden with a display:none for web version with your screen CSS.
One advice I can give you is, if you know the maximum number of PDF pages, just make the iframe height large enough... that means, if the number of pages is less, the printer is going to output empty pages.
The other advice was the one stated above, get a tool to annotate or change properties of all PDFs to contain that information.
I found this tool: http://pdfcrowd.com/html-to-pdf-api/ to convert PDF into HTML, which you can use instead of displaying PDF
I'm thinking your best bet is to have a parsed version of the PDF for printing. Open it in Illustrator and save each page to SVG and use the SVG files to print with.

pdfbox does not show even if I select check box in code

I am using PDFbox java api to fill out the values in PDF.
I can fill the textbox values. When I use check() method for checkboxes
as shown How to check a check box in PDF-form using Java PDFBOX api
it set value to true in background but that does not reflect when I open the pdf.
checkbox is still blank without any value.
does anyone know how to fix this issue ?

Expanding textbox stopping page breaks in PDF conversion

I have a simple report that has an image and a textbox within the body (a rectangle). The textbox is set to 'Allow Height to Increase'. The rectangle is set to 'Page Break After'.
Normally this works fine if the contents of the textbox span a few lines. However, when the textbox expands over multiple pages the Page Break is ignored. This only happens when exporting to PDF, yet works as expected in Preview mode.
I'm hoping someone has some insight into this behaviour or can recommend an alternative page structure that will achieve the desired results.
Could you please check the Rectangles property
kept contents together on a single page
in a parent Rectangle object, this will always keep items together where possible.
You could also set page setup settings (margins, gutters, printable page size...) to make sure that they are not affects on exported PDF document.

Editing Flexslider HTML

I'm still new to coding. I downloaded flex slider, and I have it running fine on my site and working fine. However I can't make ANY edits into my html regarding the slider. It has the 'next' and 'previous' image links on my gallery, which I would like to replace. It shows up in the html when I inspect it in firebug, yet when I run my html through my text editor (Im using text mate), it doesn't show up at all!
Any ideas why?
I think you are talking about the navigational arrows on the left and right side of the images. This can be changes in the "flexslider.css" file. If you are using textmate then the line number is 52.
Probably the easiest way is to find the image here images/bg_direction_nav.png. Right click the image and open with your image editing software eg. photoshop. Then once you have change the image just save it and it will be saved in the same folder location. If you keep the image the same size then you will not have to mess around with anything else..