Generating a PDF of what the user sees, and sending it as a binary stream to the server

Hi All,
On the final page of our Flex app, we allow the user to print out a copy of everything they've entered for their own records.
I'm wondering if there is a way for me, programmatically, to generate a PDF document that is the same as their printout (I pass a particular container to the "print" button I've got for the user), and send those bytes back to the server.  We can store this PDF along with all the rest of their data, and it would be useful as a "snapshot" of exactly what the user saw when they submitted their application.
I'm looking into Flex PDF generation, but so far haven't gotten this figured out.  I thought some folks here might be able to point me in the right direction.
Thanks!
  -Josh

Here is how you can take a snapshot.
import mx.graphics.ImageSnapshot;
import mx.graphics.codec.IImageEncoder;
import mx.graphics.codec.PNGEncoder;
import mx.utils.Base64Encoder;
private function uploadImage(rSource:IBitmapDrawable):void
                    var tBitmapData:BitmapData = ImageSnapshot.captureBitmapData(rSource);
                    var tEnc:IImageEncoder = new PNGEncoder();
                    var tBA:ByteArray = tEnc.encode(tBitmapData);
                    var tB64:Base64Encoder = new Base64Encoder();
                    tB64.encodeBytes(tBA);
                    // send tB64.toString() using POST to the server to save the image.
// call
uploadImage(this) // where parameter is an object to get the snapshot of. Can be anything including Application. ("this" in my case).

Similar Messages

  • How to Generate PDF file on the server

    Hello Everybody !
    I Need to generate a PDF File on the server, and I'm usin the command :
    "OPEN DATASET p_path FOR OUTPUT IN BINARY MODE message l_verro .
           LOOP AT t_lines.
             TRANSFER t_lines-tdline TO p_path.
           ENDLOOP.
           CLOSE DATASET p_path.  "
    The File was generated, but is corrupt . Don't Open the file, It's wrong.
    When I use the function GUI_DOWNLOAD the file is generated  right. But in the server not.
    Can someone help me please ??
    Best Regards,
    Wagner Duarte

    Hi.
    did you check this post?
    Download PDF File to SAP Application Server
    It doest the same as you are asking.
          " Write PDF Binary Data to App Server
        OPEN DATASET lv_filename FOR OUTPUT IN BINARY MODE.
        IF sy-subrc = 0.
          LOOP AT lines INTO ls_data.
            TRANSFER ls_data TO lv_filename.
          ENDLOOP.
        ENDIF.
        CLOSE DATASET lv_filename.
    Regards
    Miguel

  • I generate file (PDF, HTML, etc) the report is empty but I run in paper

    Hi
    I use oracle Report10g
    When I generate file (PDF, HTML, etc) the report is empty but I run in paper design show data, the report in the paper design show many pages, when generate file show only the information of the margin in the main seccion and the body is empty,
    Thanks

    Thanks Daniel for pointing that out.  Though you answer is helpful but I am not sure if that is what I would want to do.
    The link you provide for csv says "For each report there's an _report.xdo file that contains the XML structure of the report... "   It suggests I modify the .xdo file for each report.  I currently have 16 reports.
    Does it mean I modify the .xdo file for all 16  and what happens if someone creates a 17th report ?
    Also, what if I run the same report using different input parameters will that change the xml structure for the report  and therefore will need me to modify the .xdo again ? (I think it should not change the xml structure so the answer should be "NO" to that, unless I change the structure of the report).
    Finally, the link you provide says after doing what it suggest  "Now log back into BI publisher and select the report. You should now be able to see that CSV is now an option."
    CSV should be an option where ? on what screen/page ?  Maybe PDF is already an option for me that I cant see because I do not know where that option is.
    I was hoping there would be something I could do on the xdo_metadata sheet (in the data constraints section or elsewhere) OR in BI Publisher itself as some property of the report.
    I will try out what you suggest any ways.
    M. Jamal

  • Save the report in PDF format on the server: is it possible?

    Hi all,
    Is it possible to save the report in PDF format on the server?
    In other words, in a web application:
    1) the user requests a report
    2) the report produced in PDF format, is saved on the server, where is the Java Reporting Component
    3) the report, in PDF format, is sent to the client's user
    Thanks a lot

    PrintOutputController.export, get the byte stream, save on server.
    Sincerely,
    Ted Ueda

  • How to download a pdf file from the server from an strut application?

    Hi,
    I wan to download a pdf file from the server side to local system. Please help me how i use the down load option.

    Read up on the Struts download action [1].
    And next time, please post in the relevant forum, one of the web-tier ones [2].
    [1] http://wiki.apache.org/struts/StrutsFileDownload
    [2] http://forum.java.sun.com/category.jspa?categoryID=20
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • Is it be true to say a good and not corrupted crystal report always has the option to generate a PDF when click the printer icon on the Crystal toolbar ?

    ''please stick with your original questions thread about Crystal Report - https://support.mozilla.org/en-US/questions/970077 - locking this thread''l
    When i unistall and again install a fresh Crystal report for .Net 4.0 Its ok to generate only to pdf option when click to the print icon on crystal report viewer but in another computer it is promting the old fasion like "a dialog with many option" ,But if want to have a only option to generate only to pdf option what should i have to do when my project and crystal report is at Window server 2008 R2,Please suggest a requred answer?

    Firefox will update in increments when you use such old versions. The best thing to do is to go to www.getfirefox.com, and download Firefox 19.0.2. This is going to be much faster than updating to 3.0.19, then to 3.6, then 12, then 19 (which is the current process).

  • Generate & Export PDF/CSV on the fly without holding entire contents in mem

    Hello Everyone,
    We are using Crystal Reports JRC (in our server side application. In a typical use-case the generated report is exported into the pdf/csv format and streamed to the client/browser.
    My question is with regards to the current interface/implementation of the JRC export api(s), which returns an InputStream which is basically a ByteArrayInputStream?, Why ByteArrayInputStream ? why not a custom InputStream imeplementation which really benefits from the streaming approach, and give you the option to stream the contents as they are generated on the fly, instead of it holding the entire report contents in a byte-array, as is the case with using ByteArrayInputStream. Since, this often seems to choke our system with regards to memory footprint, when the generated report contains huge dataset.
    Please comment? Is that not possible ? Is there any reason why ByteArrayInputStream is the only way to retrieve the report contents ?
    Thanks,
    Farhan.
    Edited by: mfarhans on Feb 26, 2010 12:40 AM

    We have new place called Idea Place, look up on the right hand side. Great place to add enhancement requests.
    Or the link: http://www.sdn.sap.com/irj/scn/idea-place

  • What is User flag and how can i use it with the mails?

    Hi.
    i do wana know what is meant by user flag and how it is different from System flag.?
    can i use user flag to distinguish the mail. in my application?
    Thanks,
    Dushyant Kumar

    System flags are defined by the IMAP spec and every server has to support them.
    User flags are defined by the application. Different IMAP servers may have different
    limitations on user flags.

  • PDF's on the Server

    HI Gentlemen,
    If I deploy my application with 10gAS on a 9i Server, and send a report output out of Forms 9i via RUN_REPORT_OBJECT() to "MYFILE.PDF" and want to deliver it subsequently thru WEBUTIL to the user who initiated it from his client browser, does the filename cause any collision, if multiple users generate the file simultaneously? Or are the sessions on the server also quite independent from each other?
    Thanks, kind regards from
    Miklos HERBOLY

    A SOAP webservice would be the best way I can think of.
    Just realize that any function that attempts to connect to a remote server for any reason will prompt the user to allow the connection. There is no way around that. If they choose not to allow the connection, you will not be able to retrieve the version number.

  • What is user name  and password for SLES10 SP1 SAP Version

    Hello,
    In order to install SAP NetWeaver 7.0 - Java and ABAP Trial Version on Linux - VMware Edition , I download SLES10 SP1 Vmware SAP version from novell, when I played SLES10SP1_Test_Drive.vmx,
    the suse linux enterprse server was start. It asked me to input user name and password. I input slesuser and password is novell. But it was not correct. Who knows what user name and password I need input?
    any help ?
    Best Regards,
    George

    Hi
    I have the same issue, I tried user root and password root doesn't work I've tried couple fo "stupid" word or root user but didn't work
    Looks like we both missing file "index.html" so I suppose this is bug from Novell and SAP
    I will let you know if I found anything.
    Peter
    See this forum you question
    Where to download SLES10 SP1 SAP Version?

  • My workstations dont care what the server says

    Everything (see below) is setup on the server, but all the workstations in the network ignore the Open Directory setup. Network users dont appear in the login screen (Other does, but when I try a network username and password, it doesn't let me in). Automatic mounts don't mount. Login to the server is not accomplished for folders and sharepoints (In order to see shares on the server I have to go into Finder, browse to the server, then click "Login As" before I can see anything on the server.) No client preferences are set. I go into Directory Utility on a workstation and the server is right there, responding normally. The LDAPv3 box is checked. What am I doing wrong?? Why are the workstations not getting authentication from the server, or using the workgroup preferences, or being cooperative??
    Other Info:
    1. DNS is running. Server hostname resolves correctly, and the IP in reverse.
    2. Open Directory is setup on the server. Open Directory Master set.
    3. I set up Computer Groups, User groups, users and computers through the Workgroup Manager. Ive made sure I set home directories (which when I click Create Now do get created). And set all the preferences therein, including the box to Show Network Users on the login screen.
    4. Directory Utility on all workstations shows the Local Server, and LDAPv3 is checked.
    I dont know what else to look at...thanks!

    Hi
    The folder that is configured as a share point for Users Home Folders, is it set to Auto Mount for Home Directories? This is done on the Server. Server Admin > Server Name > File Sharing > Share Points and select from the relevant options that are available.
    Its not absolutely clear from which Directory Access application you are seeing the Authentication and Contact information. Are you only seeing this on the Server or is this the information you see on the clients?
    What do you see in the Overview Pane for the Open Directory Service?
    Tony

  • PDF Printing asking for user id and password

    Hi all,
    We are using SAP Integrated ITS 640 . We have configured the PDF printing device as mentioned in the SAP Note #  771683 . We have configured SSO in portal  for r/3 system and SSO works fine in portal for Internet services configured in backend but  when i give print by selecting PDF printer as output device, ITS is prompting for r/3 user id and password at that time to view the PDF. Once i give r/3 user id and password ,i am able to view the PDF.
    I found out that when PDF popup window opens it opens the HTTP url and not with the HTTPS url configured in the System configuration in portal. I feel this is the reason why i have been asked to enter user id and password. So could any one please let me know how to configure in R/3 backend to use the https url for PDF printing.
    Thanks,
    Vasu

    Hi Klaus,
    I checked the OSS note you have referred. We already are into SAP_BASIS patch level 18 and kernel patch level is 156 . Also i checked the RFC
    RSPO_FRONT_DISPLAY_JOB
    mentioned in the note . In that RFC i already have  BASE_URL parameter included in import parameter with note # OSS 957292 in short text. Pls let me know how to proceed further.
    Thanks / Regards
    Vasu

  • I am trying set my email (my old uni one) as the default email on my iPad. It's a microsoft exchange one. How can I do this it asks me what the server is and I have no idea how to find this out? And even if I do will that work?

    An answer to a similar question on this said they (they not specified as to who) needed to enable two things POS or something and I have no idea what that means. Is it even possible to make it my default mail if it's Microsoft exchange?

    If you're simply referring to adding a mail account that uses an IMAP server, the short answer is yes, it will work. What did you mean by default email? You can setup multiple mail accounts so you shouldn't have to worry about a default mail account. To setup additional accounts (or delete for that matter), you can go to Settings>Mail, Contacts, Calendar>Select the Account (Delete) or Add Account.
    What is your mail provider? Often you can contact your IT department, or if it's a common mail server, googling will find the server relatively easily (ie: gmail: 'Google'  'imap server for gmail'). If, by default mail, you mean your Apple ID, yes you can also create an Apple ID that uses an IMAP associated email address. Your Apple ID can pretty much be any email address as long as you have access to it to confirm the account's creation.

  • How can open a html, pdf files from the server (c:\foldername\filename)

    Hi all,
    I am developing an application. in this app i have to implement RMI.
    My problem is this, How can a client open a files from the server.
    all the html, pdf files are stored in the server's directory like C:\audit\filename.
    There is a folder on the server's C directory which contains all the html , pdf files.
    please tell me how can a client open a file from the server using RMI.
    Please send me the solution as soon as possible.
    Thanks & Regards
    Bhavishya

    That's doing it the hard way. Why not use HTTP or FTP?

  • How do you check what your user ID and password is?

    hey, anyone know how for me to find out my user id and password? I need them to start up my mail account and to download a program. I called apple but they said to either ask here or I'd have to extend my phone support, and thats too expensive for me right now, so I'm hoping somone here can tell me, thank you.
    ~Cole

    If you are accessing a mail account provided by your ISP, you should have been given an opportunity to set these when you signed up; if not, contact the ISP. If you are accessing a different email account, use the name or email address and password that you used when you signed up for it.
    If you are prompted for a password before installing an application or in the Finder, provide the username and password you used when you initially set up the computer.
    (17368)

Maybe you are looking for

  • Is PDF to Text Fixed in Lion

    When Apple released Snow Leopard they broke Preview's (and all other non-Adobe) ability to correctly convert PDF to Text. Has that been rectified in Lion? How to test: Get a (or create) 2 column PDF with a multi column Table imbeded in the middle. Se

  • Add Instance Continue to Second Page

    I have a subform where I am adding instances to.  Once page 1 is full i would like to have the instances continue to page 2. 

  • Music Sync Issues

    this isnt a question, more a helpfull answer to what i belive is a common issue since the 5.1 update. i have found since update, that there are certain songs that just arent syncing to my iPhone. its non-discriminative when it does this, choosing not

  • How much space do I have left?

    I thought there was something in settings where I could find out how much space my apps/photos etc. were using but cannot find it. I know I can do this in itunes, but want to check on the actual device. Thanks!

  • Download update error 3259 and 3253

    please look at this, i keep getting those errors 3253 and 3259 i do get those at work on windows and home on my mac