Print CSS with pdf included in page - pdf

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.

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.

Use leaflets over pdf files using angularjs

I am trying to do something like this
leafletoverimage.
Currently I am using background image and angular-leaflets tool for the click and comment.
I am trying to find out a way where I can have pdf file actually rendering on browsers, and able to click on different section of pdf file, have popover and enter comment about that section.
This is similar to what https://app.fieldlens.com/ and www.plangrid.com is doing.
is there something available in angularjs or any other solution is appreciated.

Customize PDF view inside a browser

I've worked on a requirement that allows me to show a PDF file inside a browser by doingo a Response.ContentType = "application/pdf".
The problem is that the default view of the PDF is always showing the bookmarks menu at the left, is there a way by using HTTP headers or something to tell the PDF viewer not to show the bookmarks section?
Thanks in advance.
There's two ways that you can do it. The way that I would recommend is to actually open the PDF in Adobe Acrobat and go to File, Properties. On the Initial View tab you'll see a lot of options for how to display the PDF. The second way I haven't tested but Adobe says you can pass various querystring options to the PDF. The one you'd probably want is http://example.org/doc.pdf#pagemode=none
The way how a PDF document is displayed can be configured inside the PDF document.
There are a lot of PDF editors that can modify the "viewer preferences" as it is mostly called. One free example is BeCyPDFMetaEdit.

How can I open any PDF link on a page in a popup Lightbox?

I will have a page that will regularly updated by a client (using something like TinyMCE), adding links to PDF files that I want to open in a lightbox on the page. Does code to make this a lightbox need to have the link of each PDF inside it or will the code cover any PDF links on the page? I am relativly new to lightboxes in general and was wondering if this is possible, thanks.
I believe PDF is too much for lightbox, use ThickBox with iframes instead.

Is there a way to display a PDF in an asp.net webpage without frames?

I have a PDF document that needs to be pulled up in the browser, edited, and saved. I can save via the embedded adobe toolbar, along with all the other acrobat functions. But, what I am trying to see is if there is a way to display the PDF in a webpage alongside web controls.
For example, in the top part of the webpage I have a dropdownlist. It has a list of PDFs. I select one and the bottom part of the webpage opens up with the PDF.
Thanks.
Are you looking for something like Scribd's iPaper viewer?
You can embed it on your site or host with them.
This is typically done with an iframe.
Sorry, you'll have to use either Frames, or iFrames. Perhaps you can also get it via an <object> tag, but that might get browser-specific.
I would contact the people at ceTe (makers of DynamicPDF). Their product permits you to dynamically replace your page output with a PDF file but this involves changing the entire page (the mime-type will be pdf). Is it possible to output the page to a panel instead? I don't think so, but they would be the people I would turn to.