PDF in Flex
Is it possible to display PDF's inside of Flex web app, NOT Air.
I know I can open a new window with JavaScript but I'm not allowed to do that.
Hi,
Check FlexPaper
http://flexpaper.devaldi.com/
Similar Messages
-
Hi, i wanna create a pdf or a doc in flex builder for a website, i was watching a tutorial on XPAAJ but they dont have it anymore.
i also tried fpdf where u create a pdf using php, but for some reason when i pass the data it doesnt create it.
Any ideas?
Thanks.pls check out this link
http://sunilrana.wordpress.com/2010/01/01/to-create-pdf-in-flex
also download alivepdf from
code.google.com/p/alivepdf/downloads/list
Thanks
Happy New Year -
Hai
I need to create pdf generation from flex.
I tried with LCDS and there is no way to create XDP template.
live cycle designer needs dotnet support.. but i need to do with j2ee..
is any other approach to create pdf from flex with j2ee environment???
thanks in advance...Hi there, there's a library called AlivePDF that allows you to create pdf files from Flex. Maybe that's what you're looking for.
-
How I Got WYSIWYG TLF Text To PDF from Flex
Awesome results read more here: http://hybridmindset.com/blog/How-I-Got-WYSIWYG-TLF-Text-To-PDF-from-Flex-Part-1
Hi,
Adobe Reader currently doesn't support Text to Speech, but we have added this to our database for consideration in a future release.
Thanks for your feedback!
-Gaurav -
Hi,
I'm trying to find out how to view an encrypted PDF programmatically in Flex. I would like to be able to do several things:
1) View an encrypted pdf on my local machine and do it by decrypting with the password through ActionScript.
2) Allow for viewing a pdf from a memory stream.
So far, I have been able to view a PDF using the HTMLLoader class, but I don't think this allows me to enter the decryption password for a pdf programmatically. I already have a PDF that was encrypted using Adobe Acrobat's encryption. Any help would be greatly appreciated. Thanks
-Aaronkilyas, I to once thought it would be simple to load pdf's
into flex however there is no easy way to accomplish this task.
Whenever a pdf is loaded acrobat reader is always going to want to
take over the control of this. The one solution that I however did
come up with is by using one of the HTML component renderers within
flex. Something like this
http://www.flexcapacitor.com/htmlcomponent/examples/HTMLFrameInApplication.html
once you have that component loading html urls correctly you can
then set the url straight to the pdf. This will then launch adobe
reader inside of your html component and allow the user to "view a
pdf within flex" kind of... The major flaw I've found with this is
it seems to lag when the browser window containing the flex
application is moved around as well as resized. If anyone has a
better solution though I would also like to hear it. -
Hi All,
I am doing a Reporting/Chart application in FLEX. we need to
generate PDF from FLEX. Report data will be 5-10 pages, How we can
do this? Please advise.
Thanks
SubhashHi,
thanks for your reply. I tried with alive pdf, but source
code only AIR files. can we use this in web based flex?. How we can
format the report like html code? I just see in alivepdf, its only
linebyline display, not multiple columns? pls advise.
thanks alot
Subhash -
.fdf from server and .pdf as flex resource
I'm building an internal app, so I'm not concerned about initial size. Once developed it should be cached on the local box.
I have to generate various 30 page PDF's that are already defined. I can populate them on the server using a tool like pdftk and then download them to my flex app just like any PDF.
I would like to only download the .fdf file and have the .pdf file as a resource internal to my flex 4 app. The purpose is to conserve bandwidth when the app is running at remote facilities.
It seems like the .fdf has an internal pointer to the .pdf, but I cannot seem to get it to work. I'm guessing that the path is relevant to the directory that contains my .swf.
Has anyone done this or can point me in the right direction???
A snippet of my .fdf file follows:
%FDF-1.2
1 0 obj
<</FDF<</F(/templates/NC.pdf)/Fields[
<</T(form1[0].#pageSet[0].MasterPage1[0].Resident[0])/V(Minnie Mouse)>>
<</T(form1[0].#pageSet[0].MasterPage1[0].NumericIdentifier[0])/V(1234567)>>
<</T(form1[0].#pageSet[0].MasterPage1[0].Date[0])/V(today)>>
<</T(form1[0].Page38-SectionZ[0].Z0500[0].Z0500Body[0].Z0500BYear[0])/V(1999)>>
]>>>>
endobj
trailer
<</Root 1 0 R>>
%%EOFFWIW I gave up on the idea. Using the fdf to launch the PDF has a major weakness (for my needs) in that it still allows the user to edit the form. I just want them to be able to print it. Perhaps I could defiene it as not editable, but I've got it working where I merge the two data streams on the backend and return the PDf as the response.
-
Generating PDF from Flex BarChart
Hello,
I am new to Flex. Have been playing with creating Advanced
Data Grid and Bar Charts for our application prototype and would
like to explore how to create a PDF file of the BarChart or other
charting components.
The requirement is simple. We show the BarChart and a button
to view it as a PDF. When the user presses the button, the PDF
viewing dialog should come up and the user can opt to save the PDF
or view it (the standard way a browser deals with the PDF).
Have read blogs, this forum and LiveCycle docs but don't
understand clearly how Flex communicates with
LiveCycle ES (or PDF Generator) to display the PDF. Any ideas
or tutorials that does this would be appreciated.
Thanks,
KannanIn order to generate a PDF document, you have to call a
method on a Java remote object that uses the XFAHelper and pass it
some arguments.
I modified the PDFService example in the documentation so I
can:
1- specify any document as opposed to hardcoding the PDF
template name
2- write the PDF to a file as opposed to writing it in the
user's session
Here is the source:
package com.mycompany.flex.remoteObjects;
import java.io.File;
import java.io.IOException;
import org.w3c.dom.Document;
import flex.acrobat.pdf.XFAHelper;
import flex.messaging.FlexContext;
import flex.messaging.util.UUIDUtils;
public class PDFService
public PDFService()
public Object generatePDF(Document dataset, String
PDFdocument) throws IOException
// Open shell PDF
String source =
FlexContext.getServletContext().getRealPath("/pdfgen/" +
PDFdocument);
int index = source.indexOf("./");
if(index != -1 )
// Remove the ./ added by UNIX
source = source.substring(0, index) + source.substring(index
+ 2, source.length());
XFAHelper helper = new XFAHelper();
helper.open(source);
// Import XFA dataset
helper.importDataset(dataset);
// Create a unique ID
String uuid = UUIDUtils.createUUID(false);
source =
FlexContext.getServletContext().getRealPath("/dynamic-pdf/" + uuid
+ "_" + PDFdocument);
index = source.indexOf("./");
if(index != -1 )
// Remove the ./ added by UNIX
source = source.substring(0, index) + source.substring(index
+ 2, source.length());
// Create the file object
File file = new File(source);
// Save the file
helper.save(file);
// Close any resources
helper.close();
return (uuid + "_" + PDFdocument);
pdfgen is the folder where my PDF template resides.
dynamic-pdf is the folder where the generated PDF are saved.
These two folders are located under flex.war at the first
level.
In Flex, I wrote a Cairngorm command that calls this remote
object and displays the generated PDF:
package com.mycompany.core.commands
import com.adobe.cairngorm.commands.ICommand;
import com.adobe.cairngorm.control.CairngormEvent;
import com.adobe.cairngorm.business.Responder;
import
com.mycompany.core.business.GenerateAndOpenPDFDelegate;
import
com.mycompany.core.control.event.GenerateAndOpenPDFEvent;
import com.mycompany.core.model.ModelLocator;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.collections.*;
import mx.core.Application;
import mx.controls.Alert;
public class GenerateAndOpenPDFCommand implements ICommand,
Responder
[Bindable]
private var model:ModelLocator = ModelLocator.getInstance();
public function GenerateAndOpenPDFCommand():void
public function execute(event:CairngormEvent):void
trace("Executing GenerateAndOpenPDFCommand...");
var delegate : GenerateAndOpenPDFDelegate = new
GenerateAndOpenPDFDelegate( this );
var generateAndOpenPDFEvent : GenerateAndOpenPDFEvent =
event as GenerateAndOpenPDFEvent;
delegate.generateAndOpenPDF( generateAndOpenPDFEvent.pdfVO
public function onResult( event : * = null ) : void
var item:Object;
var result:String = (event as ResultEvent).result as String;
trace("GenerateAndOpenPDFCommand::onResult\n\n" + result);
if (result)
// Open the generated PDF in a new window
navigateToURL(new URLRequest(ModelLocator.FLEX_URL +
"dynamic-pdf/" + result), "_blank");
// Hide the progress bar overlay
Application.application.requestProgressBar.visible = false;
Application.application.requestProgressBar.progressBar.source =
null;
Application.application.requestProgressBar.progressBar.label
= this.model.languageDictionary["000012"];
public function onFault( event : * = null ) : void
// Hide the progress bar overlay
Application.application.requestProgressBar.visible = false;
Application.application.requestProgressBar.progressBar.source =
null;
// Debug
Alert.show("GenerateAndOpenPDFCommand:\n\n" + (event as
FaultEvent).message);
FLEX_URL is created in this way some place else in the
application:
// Get the server URL from the Application's
var server:String = Application.application.url;
var index:uint = server.indexOf("Shell"); // Shell is the
name of my app folder
server = server.substring(0, index);
// This is the flex.war/ URL
ModelLocator.FLEX_URL = server;
Of course, it would be better to save the PDF in the user's
session as Adobe suggests, but I couldn't figure out how they use
the PDFResourceServlet. First of all, I had to get its code.
I had to decompile the java class files in the samples to get
the source of the PDFResourceServlet as it is not in the
documentation. Here it is:
package com.mycompany.flex.remoteObjects;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class PDFResourceServlet extends HttpServlet
public PDFResourceServlet()
protected void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
doPost(req, res);
protected void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
String id = req.getParameter("id");
if(id != null)
HttpSession session = req.getSession(true);
try
byte bytes[] = (byte[])(byte[])session.getAttribute(id);
if(bytes != null)
res.setContentType("application/pdf");
res.setContentLength(bytes.length);
res.getOutputStream().write(bytes);
} else
res.setStatus(404);
catch(Throwable t)
System.err.println(t.getMessage());
private static final long serialVersionUID =
0x7180e4383e53d335L; -
I know this is probably going to be for nothing since I doubt many people have been doing custom portfolios using flex yet but I have an extremely annoying problem I was hoping to get help with. I had to create my own version of the Revolve layout because the client I am working for wanted some extra things that couldnt be created using the default editor. After spending a good amount of time my component works and it does everything I need it to except for one very important thing. Upon opening a portfolio with my custom layout set as the default nothing happens and the screen is blank. I was able to figure out this is because my _host has an empty collection.items array. This only happens when I start with my layout, if I start with another and then switch to my layout everything works perfectly. I tested it more and found out that if I replace my custom Revolve component with a regular DataGrid. Everything works fine. I only get a blank pdf array when I add a custom component. Please let someone know why pdf portfolios hate me. Also, the fact that there is no test environment for them sucks, I have been forced to use Alert statement debugging.
**Update**
I did some further testing and it isnt just my custom component that portfolios hate. I made a simple custom that was a canvas with a datagrid inside and it did the same error.Windows
C:\Program Files\Adobe\Acrobat 11.0\Acrobat\Navigators -
Big text showing in PDF from flex input
Hi,
I have a problem printing data to PDF from SQL. I'm using Rich text editor as it allows the user to add bullets, bold etc... and I'm using font Family arial and font size 12 in my flex form. Now when the data goes into DB it saves all the html tags like following
Data coming from SQL is like
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Here is some text</FONT></P></TEXTFORMAT>
I'm using in PrintPDF.cfm
<tr>
<td style="font-family:Arial, Helvetica, sans-serif;
font-size:12px; font-weight:bold;">Text</td>
<td>#qryText.Some_text# </td>
</tr>
Using this the PDF show big data returning from the SQL DB.
It overwrites all the styles that I have and will show big text
Please let me know if there is a way around this...
Any suggestions....text as following:
Test Case here (This is what it is suppose to look)
Add Test Case Here, Add Test Case Here. This is a test case...(This is what is showing up)... -
Display PDF from flex windows application
Hi,
I am creating a flex windows application using action script and mxml script.I need help in displaying a PDF document in that windows application from a netwrok drive or local pc.I tried google search it is giving me some open source projects with IFrames.But,they can be only used for browser applications(web).So,anyone please suggest me how could i accomplish this task with winows application.
Thanks,
adi2010Hi ,
The solution for the thread is
<mx:HTML id="pdfHtml" location="test.html" width="100%" height="100%" />
var pdfFile:File = File.applicationDirectory.resolvePath(pdfHtml.location);
pdfFile = new File(pdfFile.nativePath);
var fileURL:String = pdfFile.url;
pdfHtml.location = fileURL;
Thanks,
adi2010. -
PDF with Flex/Flash not running on iPhone
Dear all
I have a pdf document including Flex content running perfectly in the Acrobat or Reader on Windows.
On the iPhone the Flex is not shown.
Is there any solution to this?
Many thanksFlash has never been and never will be supported on the iPad. Furthermore, Adobe has withdrawn Flash support from other mobile devices so you're out of luck.
-
Open PDF with Flex Mobile Project
I want to be able to read PDFs inside a Flex Mobile Project (I'm working with Flash Builder 4.6 and Android and iPad).
I've tried successfully stagewebview to load a pdf from a web server with this:
webView = new StageWebView(); webView.loadURL("http://<url>/Paper.pdf"); webView.viewPort = new Rectangle(0, 100,this.stage.stageWidth, this.stage.stageHeight); webView.stage = this.stage;
But what I really want it's something more visual. I mean, where you can create a flip book, go to page X, or similar. Something like this: http://devaldi.com/zine/NZ_Tourism_2007.php?ro=flash,html
I've already tried FlexPaper, but Zine doesn't work on Flex Mobile Project.
Do you know if there is something to do this? or how can I do this?
Is there any native-extension or something?
Thanks in advanceThanks Keith, I'll have a look at that. In addition to opening a PDF, I want to be able to encode an anchor id in to the open command to jump a specific anchor; I'd concluded that on iOS, until Adobe add decent url-scheme support, that was a no go - so I've been staring down the barrel of converting the .pdf to HTML and tidying up the inevitable issues manually. Here's hoping Print2Flash will help avoid that!
-
Preview ppt,word,excel,pdf in flex using iframe
hi,
i am working upon flex 4.6 web application.i have a requirement in my project to preview ppt,pdf,word and excel inside flex container. i have achieved previewing only pdf by using flex-iframe 1.5.1, since pdf has browser plugginn. i am just binding the download path what i am getting from the server to the source of my iframe In HTML5 we can preview it using iframe by binding it to google docs viewer. i tried doing the same in flex but for me its showing that because of the security constaints of the owner cannot display it rather open it in another tab.
kindly suggest me a way to preview ppt,word and excel inside flex container using iframe or if any other better or simple approach is there.
kindly help... any help would be greatly appreciated.
heres is my code-
<mx:VBox id="vbxFrame" width="100%" height="100%" backgroundColor="#FFFFFF" includeIn="pdf" verticalCenter="0" horizontalCenter="0">
<flexiframe:IFrame id="iframeFlexpdf" backgroundColor="#cccccc" width="100%" height="100%" horizontalCenter="0" verticalCenter="0" source="any url"/>
</mx:VBox>Refer to the LOB Datatype sample.
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm -
Inserting/manipulating PDF in Flex 3 AIR project?
I've read as much as I can find about dropping a PDF into my
Flex 3 AIR project, but the information is scarce and I understand
it's a very new (not fully baked) feature.
Can anyone describe what component to use to drop a PDF into
my AIR project? I need to manipulate the PDF from within AIR and
would prefer not to abstract through the HTML Container object
(e.g. calling JS through the HTML Container object).
Thanks,
Mikelooks like your equipmentArray is empty. Put a breakpoint inside that method to see if there is any data.
-
I posted this in an Acrobat forum, but I was wondering if
Flex would work for this. Anyone have any thoughts? Thanks!!
Hopefully someone can help me! I am a designer, not a
programmer so I may be in over my head. My client has an archive of
individual technical data sheet saved as PDFs. They would like a
user to be able to go to a web page, select which products they use
and have that automatically combined into one PDF file. Any ideas
on where to start? Thanks!Hi there there's a library named AlivePDF that allows you to
create PDFs on the fly. But if you're not a developer, and don't
want to learn about Flex and AS3, then you'll probably couldn't be
able to accomplish this.
Maybe you are looking for
-
PR/PO release strategy should be revoked
Hi Experts, How to revoke the release of a PR /PO if value is decreased. In standard only value increase will revoke the release strategy. I am having overall release of a PR. Regards
-
How to make stock zero in the past date
Dear all, My client has implemented sap recently and during the start up the material update was done using movement 561. They have taken the physical inventory on 30.06. Now they want to undo some of the material movements so that the stock on 30.06
-
Indexing a membership directory in CS2
I'm building a 256 page membership directory. There are 8 sections and a member may be listed in more than one section. These listings are being imported from 55 different Excel files. I want to create an index in the back that will list members in a
-
I can't read the code to type when posting on the community page like craigslist
Hi, I'm troubled when posting in craigslist through firefox. I cannot read the code or a word to type when posting for a security purpose (spam). This problem has started a couple months ago with Firefox. With Safari, this does not happen. Appreciate
-
Dear All, what is the conceptual and functional difference between peripheral target and Enterprise peripheral target?