1

I want to display a PDF file in browser and control the font used in the PDF. For example, I should be able increase and decrease the font size.

Currently, I am using an <object> element to display the PDF. To fetch this PDF I am making an HTTP request to the server and setting the URL attribute of the <object> element. But this does not provide much ability to control the content of PDF document like increase and decrease the font size.

How can I control the font (increase and decrease) of a displayed PDF in Object tag? is there some way to do it via javascript?

My sample code is here:

<object width="auto"
        height="auto"
        classid="clsid:19DDC62D-DB2C-48BA-88F8-9678DCBE0257"
        url="http://test.net/?doc_id=1212"/>
user1591156
  • 1,945
  • 4
  • 18
  • 31
  • Achieve what using JavaScript? Parse and display a PDF? Or create an object tag dynamically? – Brigand Feb 14 '13 at 20:40
  • "But it does not provide much ability to control the content of pdf document." what are you talking about ? what do you want to control? – mpm Feb 14 '13 at 20:40
  • see http://stackoverflow.com/questions/8798745/how-to-get-html-elements-from-an-object-tag?rq=1 – Rachel Gallen Feb 14 '13 at 20:41
  • @RachelGallen... your link seems nothing like the question he's asking, and it doesn't even have an accepted answer – Mike Feb 14 '13 at 20:44

1 Answers1

0

You can try: http://pdfobject.com/

"PDFObject embeds PDF files into HTML documents"

You can use their generator http://pdfobject.com/generator.php to optimize the look and feel of the embeded pdf.

psu
  • 379
  • 1
  • 5
  • 15
  • this looks great. does this also give ability by which i can change the text font of pdf after converting in to HTML? – user1591156 Feb 14 '13 at 21:05