Scrollable HTML Content in pdf - html

I have a scrollable div in HTML.
I want to achieve scrolling in PDF.
How do I convert HTML to PDF and achieve this?
Is it possible to embed HTML code inside a PDF file?
If not, what are other ways to obtain a scrolling content inside a PDF file?
Edit:
I have Seen a pdf with scrollable content : Snipp From pdf :
How this is achieved ? Anyone

yes, it is possible to append html in pdf Using php TCPDF library, it also supports inline css but i am not sure if it supports overflow or not....but yes it is possible to embed HTML in pdf using TCPDF and is the advantage over FPDF...

No. There is no way for you to do that. A PDF viewer does not have a browser inside it, nor does it have a plug-in mechanism for you to embed something "foreign" inside the file.

Related

Insert an image into an html page without using outer resources using XSLT

I've just received an absoultely mad task of writing an xsl file that should provide an html page as an output.
The trick is that the only external resource allowed to be used is a css file. The page contains a number of images for elements that can't be generated with css. I know there is a way to embed images into an XSL file as, for example, a Base64 code.
Is there a way to insert these images into the resulting html? %)
Why can't you use CSS embedded image example?
There are many other examples available: https://www.google.ch/search?q=css+embedded+image

How do I stop images or flash from loading into the browser?

I am creating a web page that accepts a hyperlink from the user and displays that page in an iframe. While rendering the page, I would like to show just the text and simple colors, thats it.
I would like to block all the media files like images and flash scripts from showing up.
If not an extensive one, for the starters, I would like to confine the scope to .gif, .jpeg, .jpg, .png, .swf.
Or does anyone know of a site with similar functionality?
You can write a simple dom parser and parse the page before show it in iframe. Then before showing it you can remove whatever you want.
your iframe whould like
<iframe src="your_parser.php"></iframe>
In your parser you can get the content from page using file_get_contents() or curl() it is your choise (i would use curl). Then you can remove the media you want.
If you're using Firefox, use the Adblock Plus extension. You can specify the types of items to block via a filter rule. An example (using Safaribooks) looks like this:
||techbus.safaribooksonline.com/static/201109-2191-techbus/images/6.0/*.jpg
However, if you're talking about incorporating functionality into your page to strip out a specific list of content-types, this approach wouldn't help you. You'd need to pull the html source and strip out the offending content-types.
also if you are using cms. you should be turn off bbcode image, and embed html

Embed png image in html file using Jinja2

I'm using Jinja2 to create html reports as a single html file. I would like to include the company logo inside the html file rather than link to it; in this way the logo is displayed even if the person reading the report is offline. Can this be automatically done using Jinja2? If not how can I embed a png image in the html manually?
look for a Base64 encoder on Google (e.g. http://www.opinionatedgeek.com/dotnet/tools/base64encode/). After that you can insert
<img src="data:image/png;base64,BASE64_ENCODED_DATA">
in place for the logo :)

Embedding PDF using <embed>

I am trying to embed a PDF in my webpage using this HTML tag
<embed src="instructions_after_extraction.pdf#navpanes=0" style="width:500px; height:375px;" />
If you have noticed, I have turned off the navigation panes using navpanes=0. However, is there a way to specify the available buttons in the toolbar? I'm already aware that toolbar=0 removes the toolbar from the display, but is there a way to turn off each button separately?
Regards.
I don't believe such control exists. However, on a side note, I would be vary of using the embed tag in the first place. An object tag with a number of parameters is the more appropriate solution.
The GUI settings with which a PDF needs to be displayed can be specified by the PDF-creation software too.

What are iframe alternatives?

Is iframe should not be used ever?
how screen reader behaves with
iframed content?
Without iframe how we can embed any
PHP page into asp.net based site?
What are cross browser alternatives?
I don't see why using an iframe is a problem.
If you can't use it then you could either use javascript to download and insert the generated html from the php page, or you could download the html in your asp.net server-side code and insert the html in a control.
Either approach should work well, but using javascript across domains is difficult.
If you go for the asp.net server-side approach you could do the following:
First insert an control where you want to include the html from the php page
In your Page_Load event use the WebClient to download the html as a string
Remove the <html>, <head> and <body> tags so that you only have the pure html markup. You may want to add any script- and css-references to your page if they are needed.
Assign the cleaned html to the Label controls Text property.
This will work, but there are a few points to make:
First you should consider if you trust the source of the php page. If you don't then you will want to do some extra cleaning of the html before displaying it
Second, you will probably want to cache the downloaded html so that you don't have to download it for each page view.