Forum: Ruby on Rails pdf render inline .... update 'main' div

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
62e2a6d9218988e3b0b9c2869b63a157?d=identicon&s=25 bruce davison (Guest)
on 2006-04-28 00:40
(Received via mailing list)
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
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 Jeremy Kemper (Guest)
on 2006-04-28 00:55
(Received via mailing list)
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
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
Cb610750ee94ca103aef4b2dc7b1b768?d=identicon&s=25 Nick Stuart (Guest)
on 2006-04-28 00:58
(Received via mailing list)
You wont be able to 'implant' a pdf like this into a page. The whole
output has to be the pdf file.

-Nick
62e2a6d9218988e3b0b9c2869b63a157?d=identicon&s=25 bruce davison (Guest)
on 2006-04-28 02:11
(Received via mailing list)
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 Kemper 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
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
62e2a6d9218988e3b0b9c2869b63a157?d=identicon&s=25 bruce davison (Guest)
on 2006-04-28 02:23
(Received via mailing list)
Ok answer my own question....

the partial _ pdf.rhtml
looks like this
<OBJECT CLASSID="CLSID:CA8A9780-280D-11CF-A24D-444553540000"
WIDTH="800" HEIGHT="600">
<PARAM NAME="src" VALUE="pdf/mypdf.pdf">
</OBJECT>
This works!

Bruce

On 28/04/2006, at 8:55 AM, Nick Stuart 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 <bruce@yourweb.com.au> wrote:
>
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
This topic is locked and can not be replied to.