# Pdf render inline .... update 'main' div

**URL:** <https://www.ruby-forum.com/t/pdf-render-inline-update-main-div/59030>\
**Category:** Rails\
**Created:** [April 28, 2006, 12:40am UTC](https://www.ruby-forum.com/t/pdf-render-inline-update-main-div/59030 "2006-04-28T00:40:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce\_davison](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f1d935/32.png) [@bruce\_davison](https://www.ruby-forum.com/u/bruce_davison)\
**Post date:** [April 28, 2006, 12:40am UTC](https://www.ruby-forum.com/t/pdf-render-inline-update-main-div/59030/1 "2006-04-28T00:40:05Z")

</div>

Hi,  
I want to keep the layout and just to a link\_to\_remote to update the  
div id ‘main’

Using this in the controller action  
send\_file “public/pdf/my.pdf”, :type =\> ‘application/pdf’, :disposition  
=\> ‘inline’, :stream =\> false

I get this.  
The raw pdf code sent replacing the main div with :  
%PDF-1.4 %ÿýÿýÿýÿý 2221 0 obj \<\> endobj  
xref 2221 35 0000000016 00000 n  
0000002153 00000 n 0000000996 00000  
n 0000002322 00000 n 0000002802  
00000 n 0000002914 00000 n  
0000003055 00000 n 0000003191 00000  
n 0000003329 00000 n 0000003443  
00000 n 0000004101 00000 n  
0000004129 00000 n 0000004157 00000  
n 0000004780 00000 n 0000005171  
00000 n 0000005199 00000 n  
0000005959 00000 n 0000006629 00000  
n 0000007349 00000 n  
etc etc etc

Any clues?  
Thanks  
Bruce

---

<div class="post-metadata">

**Author:** ![bruce\_davison](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f1d935/32.png) [@bruce\_davison](https://www.ruby-forum.com/u/bruce_davison)\
**Post date:** [April 28, 2006, 12:55am UTC](https://www.ruby-forum.com/t/pdf-render-inline-update-main-div/59030/2 "2006-04-28T00:55:25Z")

</div>

On Apr 27, 2006, at 3:38 PM, bruce davison wrote:

> %PDF-1.4 %ÿýÿýÿýÿý 2221 0 obj \<\> endobj xref 2221 35 0000000016  
> 00000 n 0000002153 00000 n 0000000996 00000 n 0000002322 00000 n  
> 0000002802 00000 n 0000002914 00000 n 0000003055 00000 n 0000003191  
> 00000 n 0000003329 00000 n 0000003443 00000 n 0000004101 00000 n  
> 0000004129 00000 n 0000004157 00000 n 0000004780 00000 n 0000005171  
> 00000 n 0000005199 00000 n 0000005959 00000 n 0000006629 00000 n  
> 0000007349 00000 n  
> etc etc etc
> 
> Any clues?

The browser doesn’t know what kind of data it’s receiving. Try :type  
=\> ‘application/x-pdf’

Best,  
jeremy\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![bruce\_davison](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f1d935/32.png) [@bruce\_davison](https://www.ruby-forum.com/u/bruce_davison)\
**Post date:** [April 28, 2006, 12:58am UTC](https://www.ruby-forum.com/t/pdf-render-inline-update-main-div/59030/3 "2006-04-28T00:58:30Z")

</div>

You wont be able to ‘implant’ a pdf like this into a page. The whole  
output has to be the pdf file.

-Nick

---

<div class="post-metadata">

**Author:** ![bruce\_davison](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f1d935/32.png) [@bruce\_davison](https://www.ruby-forum.com/u/bruce_davison)\
**Post date:** [April 28, 2006, 2:11am UTC](https://www.ruby-forum.com/t/pdf-render-inline-update-main-div/59030/4 "2006-04-28T02:11:10Z")

</div>

Jeremy,  
Thanks for the response  
application/x-pdf doesn’t do it either … I guess the browser is  
getting confused with multiple doc types … maybe iframe could help, or  
just use Flex as the UI and be done with all of these problems.

Bruce

On 28/04/2006, at 8:54 AM, Jeremy K. wrote:

On Apr 27, 2006, at 3:38 PM, bruce davison wrote:

> %PDF-1.4 %ÿýÿýÿýÿý 2221 0 obj \<\> endobj xref 2221 35 0000000016 00000  
> n 0000002153 00000 n 0000000996 00000 n 0000002322 00000 n 0000002802  
> 00000 n 0000002914 00000 n 0000003055 00000 n 0000003191 00000 n  
> 0000003329 00000 n 0000003443 00000 n 0000004101 00000 n 0000004129  
> 00000 n 0000004157 00000 n 0000004780 00000 n 0000005171 00000 n  
> 0000005199 00000 n 0000005959 00000 n 0000006629 00000 n 0000007349  
> 00000 n  
> etc etc etc
> 
> Any clues?

The browser doesn’t know what kind of data it’s receiving. Try :type  
=\> ‘application/x-pdf’

Best,  
jeremy\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![bruce\_davison](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f1d935/32.png) [@bruce\_davison](https://www.ruby-forum.com/u/bruce_davison)\
**Post date:** [April 28, 2006, 2:23am UTC](https://www.ruby-forum.com/t/pdf-render-inline-update-main-div/59030/5 "2006-04-28T02:23:26Z")

</div>

Ok answer my own question…

the partial \_ pdf.rhtml  
looks like this

This works!

Bruce

On 28/04/2006, at 8:55 AM, Nick S. wrote:

You wont be able to ‘implant’ a pdf like this into a page. The whole  
output has to be the pdf file.

-Nick

On 4/27/06, bruce davison [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
