PDA

View Full Version : How does one display PDFs in a panel?



alphadogg
16 Jan 2011, 8:20 PM
What are my options for displaying a PDF in one of the panels of a border layout?



CPOPExt.UIObjects.Body = function() {
return ({
layout: "border",
border: false,
items: [
{
region: "north",
id: "bodyTopContainer",
layout: "border",
height: 30,
border: false,
items: [{
region: "center",
id: "bodyTopTitle",
border: false,
html: "Manage Forms"
},
{
region: "east",
id: "bodyTopFunctions",
bodyCssClass: "bodyButtonPanel",
width: 120,
border: false
}]
},
{
region: "center",
layout: "fit",
id: "BodyCenterContainer",
items: [CPOPExt.UIObjects.Grid],
split: true,
border: false
},
{
region: "south",
title: "PDF Viewer",
id: "BodyBottomContainer",
height: 200,
border: true,
split: true,
collapsible: true,
collapsed: true
}
]
});
};

devtig
16 Jan 2011, 10:45 PM
I'd say in an iframe using the ux Managed Iframe
http://www.sencha.com/forum/showthread.php?71961-3.0.x-3.1.1-ux.ManagedIFrame-2.x

Condor
17 Jan 2011, 12:45 AM
ux.Media (http://www.sencha.com/forum/showthread.php?23983-ux.Media-.Flash-Flex-Components-2.1.2) would seem more appropriate, but an IFRAME works too.

alphadogg
17 Jan 2011, 5:02 AM
Are there pros and cons either way?

Condor
17 Jan 2011, 5:32 AM
ux.Media uses an <object> or <embed> tag that lets you configure the pdf reader (e.g. hide the toolbar).

devtig
17 Jan 2011, 5:38 AM
Use Chrome browser to go to the ux.Media demo at http://demos.theactivegroup.com/demodesk.html . Then click on the ux.Media button and then Acrobat (PDF) Documents. Then choose the second tab. Chrome than zooms to 10% automatically ...

Condor
17 Jan 2011, 6:05 AM
That's a bug in Chrome or the PDF plugin. You can't really blame ux.Media for that.

alphadogg
17 Jan 2011, 6:01 PM
Actually, currently using FF3.6.13, the demo (http://demos.theactivegroup.com/) for ux.Media opens a PDF in an external instance of Reader. On the left side bar, click the ux.Media little black arrow. Select the PDF option. In IE, the default tab shows a little "missing image" icon and the IFRAMED tab results in a download box and shows in a separate window. In FF, I immediately get a PDF popup with either tab.

I know FF now has a separate plugin container now for the more popular plugins. This may be playing a role, because this behavior happens at other sites. However, I need to display the PDF inline in the browser. There may not be a way to do this...

Condor, do you use this extension in actual production use?

Condor
17 Jan 2011, 11:37 PM
This only works if you have the PDF plugin installed in browsers (did you unselect the plugins when installing Acrobat Reader?).

alphadogg
18 Jan 2011, 5:41 PM
My bad. Turns out the workstation I was using did not actually have Reader's plugins installed, even though it had Adobe Acrobat Standard.

Once installed, it worked.