Submit a PDF as a PDF to a servlet, and how to get my PDF from servlet

Hi all as the title above,
i have a button typeformat as PDF and sent to a URL( which is my servlet )
after this step how to get the PDF from my servlet.
the PDF has sent to my servlet and stop, so is there any way to get the PDF i sent ?
can someone help me?
thanks

You can use the following code:
byte[] content = getRequestBufferAsBytes(request);
...then do whatever you want
public static byte[] getRequestBufferAsBytes(HttpServletRequest request) throws IOException, ServletException
// get the RequestBuffer
ServletInputStream oInput = request.getInputStream();
long nContentLength = request.getContentLength();
String contentType = request.getContentType();
if (nContentLength <= 0)
return null;
byte[] cContent = new byte[(int)nContentLength];
// read the content in 512 bytes chunks
// a single read does not get all the characters
int nRead = 0;
int nToRead = (int)nContentLength;
int nBlkSize = 512;
byte[] cTemp = new byte[512];
do {
int n = 0;
int i = 0;
if (nToRead - nRead < 512)
nBlkSize = nToRead - nRead;
n = oInput.read( cTemp,0,nBlkSize);
for (i = 0; i < n; i++)
cContent[i+nRead] = cTemp[i];
nRead += i;
} while (nRead < nToRead);
//cContent[nRead] = (byte)'\0';
Long nBytesRead = new Long( nRead );
return cContent;
Jasmin

Similar Messages

  • All my excel files were converted to pdf. Why would this happen and how do i stop it from doing so?

    All my excel files were converted to pdf. Why would this happen and how do i stop it from doing so?

    shloimypt wrote:
    All my excel files were converted to pdf. Why would this happen and how do i stop it from doing so?
    Relax, they weren't converted to PDF.
    You can tell by right clicking ANY of them and choosing "Properties". You'll see there that they're STILL .xls or .xlsx files. The "association" has changed and Windows now indicates that they open with Reader, which isn't right.
    Where it says "Open With" under the General tab, you can click "Change" and re-select Excel as the default app to open thim.
    See: http://helpx.adobe.com/acrobat/kb/application-file-icons-change-acrobat.html

  • How to create PDF with Form Builder (T-Code:SPF) and how to use it?

    How to create PDF with Form Builder (T-Code:SPF) and how to use it? Is there anyone can show me some doc. or PA material ? << removed >>  Thank you very much!!
    Edited by: Rob Burbank on Nov 11, 2010 1:04 PM

    PDF forms also known as Adobe From or Interactive Forms.
    Check this link -
    Interactive Forms
    REG:ADOBE FORM
    Adobe forms
    Regards,
    Amit

  • How to get the Pdf's page size?

    Hi,
    Anyone can tell me how to get the pdf's page size with js in acrobat?
    Regards
    Goldbridge

    The page size will not always necessarily conform to a standard size such as A4 - PDFs can be defined at any abstract size a user wants. Having a function that only output standard sizes would greatly limit its ability, so it was left up to the user to calculate whether or not the returned rectangle is a standard size as that satisfies many more workflows than the opposite method.

  • How to get the PDF data which i have send to Spool

    Dear Freinds,
                   My requirement is to display the output which iam getting from a custom report(ZSALARY) in the form of  PDF . So now i wanted to display the ALV output  on to my desktop (as of now) in PDF format.
    i have done the below coding please correct me why iam not getting the same data which is coming out of my report in the PDF, iam passing the same internal table.
    IF NOT it_final[] IS INITIAL.       -
    >IT_FINAL is my main internal table in the report ZSALARY
          DATA : count TYPE syprcop,
             days TYPE sypexpi,
             params TYPE pri_params,
             valid TYPE c,
          pdf_table TYPE  rcl_bag_tline,
          spoolid TYPE rspoid,
          pdf_fsize TYPE  i.
            CALL FUNCTION 'GET_PRINT_PARAMETERS'
              EXPORTING
                destination    = 'LP01'
                copies         = count
                list_name      = 'ZSALARY'   -
    tHIS IS MY REPORT NAME
                list_text      = 'ZSSPOOL'
                immediately    = ' '
                release        = 'X'
                new_list_id    = 'X'
                expiration     = days
                line_size      = 90
                line_count     = 65
                layout         = 'X_PAPER'
                sap_cover_page = 'X'
                receiver       = 'SAP*'
                department     = 'System'
                no_dialog      = 'X'
              IMPORTING
                out_parameters = params
                valid          = valid.
            NEW-PAGE PRINT ON PARAMETERS params NO DIALOG.
            WRITE : 'hi this is the test for spool'.
            NEW-PAGE PRINT OFF.
            COMMIT WORK.
            WRITE : / 'The Spool no is ', sy-spono. "system variable for spool no
            spoolid = sy-spono   .       -
    At this point i can see the spool no.
            CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
              EXPORTING
                src_spoolid   = spoolid
                no_dialog     = 'X'
              IMPORTING
                pdf_bytecount = pdf_fsize
              TABLES
                pdf           = pdf_table
              EXCEPTIONS
                OTHERS        = 0.
            CHECK sy-subrc = 0.
            CALL FUNCTION 'GUI_DOWNLOAD'
              EXPORTING
                bin_filesize = pdf_fsize
                filename                = 'C:\Documents and Settings\Administrator\Desktop\test.pdf'
                filetype                = 'BIN'
              TABLES
                data_tab                = it_final
              EXCEPTIONS
                file_write_error        = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
          ENDIF.
    if i go and on my desktop it is saying the below error "ADOBE  READER COUDNT OPEN 'test.pdf'
    because it is either not supported  file type or because the file has been damaged.
    my aim is to get the data which is there in IT_final in the PDF .....please correct me the parameters which i have given wrong. my doubt is in GUI_download  fM  in the tables should i pass it_final or
    the pdf_table coming from'CONVERT_ABAPSPOOLJOB_2_PDF'...... i tried this option iam able to open and it is just giving message which i kept before this FM i.e  WRITE : 'hi this is the test for spool'.
    what i should to get my internal table data.
    Pls help.
    regards
    srinivas.

    Dear Karthik,
              Thank you for giving me the link there by iam able to get the ouput download int he pdf
    as below code , but now a small problem for me .......i have 10 fileds in the Report ouput ....but however in the pdf output i can see only 8 fields and the two fields got truncated . Could you please tell me what
    i have to change in my below code so that i can get all the values  
    IF NOT it_final[] IS INITIAL.
    data : it_tsp01 type standard table of tsp01,
           l_wa_tsp01 type tsp01.
            CALL FUNCTION 'GET_PRINT_PARAMETERS'
              EXPORTING
                destination    = 'LP01'
                copies         = count
                list_name      = 'ZHR_BON'
                list_text      = 'ZSSPOOL'
                immediately    = ' '
                release        = 'X'
                new_list_id    = 'X'
                expiration     = days
                line_size      = 90
                line_count     = 65
                layout         = 'X_PAPER'
                sap_cover_page = 'X'
                receiver       = 'SAP*'
                department     = 'System'
                no_dialog      = 'X'
              IMPORTING
                out_parameters = params
                valid          = valid.
    SUBMIT (sy-repid) TO SAP-SPOOL
                     SPOOL PARAMETERS mstr_print_parms
                     WITHOUT SPOOL DYNPRO
                    WITH pnppernr =  p0001-pernr
                     AND RETURN.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
              EXPORTING
                src_spoolid   = spoolid
                 no_dialog     = 'X'
                 DST_DEVICE  = params-PDEST
               IMPORTING
               pdf_bytecount = pdf_fsize
              TABLES
                pdf           = pdf_table
              EXCEPTIONS
                OTHERS        = 0.
            CHECK sy-subrc = 0.
            CALL FUNCTION 'GUI_DOWNLOAD'
              EXPORTING
                bin_filesize            = pdf_fsize
                filename                = 'C:\Documents and Settings\Administrator\Desktop\test.pdf'
                filetype                = 'BIN'
              TABLES
                data_tab                = pdf_table    "it_final
              EXCEPTIONS
                file_write_error        = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
          ENDIF.
    Please tell me how i can get the all the fields which are there in my normal alv output ......
    Case 1) .i wanted all the 10 fields in PDF  to be displayed  without truncated , I have checked in Spool ........ i found all the fields are there .....but however when i check the downloaed PDF i can see some fields are getting truncated.
    Case 2) However  if on the ALV output if the user  hides 2 fields out of 10 fields then only 8 feilds which are appearing on the output  before sending the Spool should only be displayed in PDF as well -
    > for this scenario what i have to do.
    Thanks  Once again.
    regars
    srini.

  • How to get a pdf document out of a Document form

    Hi all,
    I have a question of how to get the actual PDF out of a Document Form, when I take the @document value I only get some xml representation of the form, but I need to get the actual PDF.
    Thanks in advance
    Sincerely
    Kim

    The @document is the way to get the PDF out from the DocumentForm varibale. If you get just the data, it's because the DocumentForm was populated with just the data in the first place.
    Make sure you submit PDF from your form and not just the data.
    Jasmin

  • How to get page number from the PDF using Javascript

    Hi,
    We are having list of Single page PDF. The pdf are named in the order,
    ISBN_Author_01.PDF  (with real page number as i)
    ISBN_Author_02.PDF  (with real page number as ii)
    ISBN_Author_03.PDF  (with real page number as iii)
    ISBN_Author_04.PDF  (with real page number as 1)
    ISBN_Author_05.PDF  (with real page number as 2)
    ISBN_Author_06.PDF  (with real page number as 3)
    ISBN_Author_nn.PDF  (with real page number as 500)
    Here each pdf has a page number and in sequential order.
    The task is to check whether all the pdfs are in sequential order (i.e i, ii, iii, 1, 2, 3). If any page is missing, the script should throw an error report.
    To do this task, I am writing a Javascript to get the real page number from the PDF.
    Can anybody help me how to get the page number from the PDF using Javascript.
    Thanks,
    Gopal

    The "real" page number within a PDF is the count of the physical page starting at 0, zero.
    pageNum numPages
    The number printed on each page is the page label.
    setPageLabels  getPageLabel
    You will have to open each PDF and your script would need to know the page label for that file. I would expect you would need to build a 2 dimensional  array of the file names and the page label for the page within that array.

  • Placed PDF with Layers - can layers be maintained and exported in a new PDF?

    Can a layered PDF placed in InDesign include these layers in the InDesign Layers Panel? I have a layered PDF created in Illustrator CS4. I'm placing it in InDesign CS4 6.0.4 and want to export a PDF with the layers in tact from Illy. I use the Show Import Options dialog box and can see all of the layers in the layers tab. I tried both options for update links so that choice seems unimportant. I only see one layer, Layer 1, in the InDesign layers panel after placing the PDF. I was expecting to see all of the layers from the placed PDF. I exported as Acrobat 6 with Create Acrobat Layers checked but the only layer in the exported PDF is Layer 1. I searched and read for quite some time and can’t figure it out. Maybe I’m expecting something that isn’t possible but it sounds like it should be. I tried placing it as a native AI file with the same results. Where am I going wrong?
    Thanks,
    Glenn

    Thanks to Bob and Peter. I understand what you said. It seems as though the ability to place a file with layers should allow you to take advantage of it better. This is a map that will allow users to turn on or off various points of interest, hotels, etc. Now I realize I can at least control them from the place dialog box so, other than having to place the same map multiple times I end up with what I wanted. Thanks for the soultions.
    Glenn

  • How to get dom object from acrobat pdf

    I am following the the document "PDF Accessibility API Reference" and following the section "Reading PDF files thru DOM Interface". There he mentions about including
    AcrobatAccess.h, AcrobatAccess_i.c and IPDDom.h. Please let me know where I can find these files. Also, How can I get a dom object to start with. If you have a sample code to share, that would be great. I tried googling about these but was not very successful in getting this info.
    Any help towards this is appreciated.

    Hi Leonard,
    I think there is something called GetCaret function mentioned in DOM interface which basically returns IPDomNode underneath caret. Also, in Accessibility side, accHitTest() function is there.
    I think today when I explored our product, some body has written wrappers over accessibility apis to get some good information. Anyways thank you very much for all your replies.
    One last question before I leave home:-)
    I have accessibility object representing a active page (page which is visible). Now using accessibility apis, I can traverse the tree of accessbility objects that belong to/Underneath page. Now to get the same on a different invisible page, what should I do. Calling getParent at a page level accessibility object returns null? SOmething like I want an accessibility object whose children are "the all the pages of the document".

  • How to get the PDF Document version when using Digital Signature

    Hi,
    I have a form which contains two signature fields.
    When i sign the form the pdf document is saved as a version which can be seen by clicking the Signature Panel.
    I need to get the binary of the versions stored in the form.
    Please suggest me the how to get the version data from the form.
    Regards,
    S.V.atish Kumar

    Hi Mithun:
    I think I have run into a similar issue and have not been able to find a resolution.
    I have been trying to place three groupings of data and limit them to 15 rows; additional rows would print on a void check on a next page using the rtf template.
    Earnings .............. Pre-Tax Deductions .........Taxes
    <line 1 earnings> <line 1 pre-tax deductions> <line 1 tax dedcutions>
    <line 2 earnings> <line 2 pre-tax deductions> <line 2 tax dedcutions>
    <line 3 earnings> <line 3 pre-tax deductions>
    <line 4 earnings> <line 4 pre-tax deductions>
    <line 5 earnings>
    <line 6 earnings>
    The template works fine with these lists as nested tables until I add in the restriction and filler for the 15 rows for the first table. The data in the 2nd two lists does not appear once the limitation is added.
    Check Writer (XML)  - Issues with payroll check stub in rtf
    As an alternative, I have been thinking adding the remaining line totals (over 15 rows) and adding a 16th row. However I have been running into an error when trying to use the code for-each-group.
    *** XML-22056: exactly one of four group attributes must be present in xsl:for-each-group
    Can you send me your template to review? My email is: Karen.Lacey(AT)paetec(DOT)com
    Thanks!
    Edited by: RedLacey on Dec 17, 2009 11:48 AM

  • How to get a PDF file in iMovie ?

    Hello,
    I have a sketch as a PDF file on my desktop.
    How can I get this sketch in iMovie '11 ?
    Thanks for your answer !
    John

    Thank you, but I have to be more clear ...
    I received a drawing from a friend - a Windows user - as a "docx" file.
    When I clicked on it, it opened in Pages '09 version 4.0.5 with a message popped up stating : - Some warnings occurred. Would you like to review them now ? You can review warnings at any time by choosing View > Show Document Warnings.
    With "Don't Review" or "Review" commands.
    I clicked on "Review" and saw a Documents Warning stating a Missing font Calibri.
    Clicking on Share > Create a PDF document that can be viewed and edited with a PDF application, or viewed in a web browser. Image quality 'Good' . And command 'Next …' and saved as ' logos1.pdf ' on Desktop command EXPORT.
    It opened in Adobe Reader and I saw this message :
    - This document does not allow you to save any changes you have made to it unless you are using Adobe Acrobat 9, Adobe Acrobat Pro 9, or Adobe Acrobat Pro Extended 9. You will only be saving a copy of the original document. Do you want to continue? -
    The Adobe Reader vs 9.4.2 was put on my Mac years ago …
    I have the feeling I'm circling around a problem while NOT knowing how to get the sketch file in iMovie '11 …..
    Please tell me what do I do wrong ?
    Or should I ask my friend to resend the logo in another, and what file format ?
    Hope I could make myself understandable, after several years living as a dutchman in France ?

  • How to get the PDF Convert button to show on Internet Explorer 9

    Using Internet Explorer 9 and Adobe Acrobat 9 and the PDF convert button does not show up.  How do I fix this?

    Hi R Voorheis
    Please refer to How to install Adobe PDF toolbar in Internet Explorer and https://helpx.adobe.com/acrobat/kb/convert-current-web-page-pdf.html

  • How to get the PDF Text position, font, size, align...?

    Hi~!
    I can extract all the text from the PDF file, but just plain text.
    I need their format, position, font, size, align.
    I am using C#, IAC, and read the SDK carefully.
    How to get them?
    Thanks for every hint on how to achieve this!
    Jason Wang

    "Often this is a rectangle, sometimes not (e.g. for italic text the box
    may be slanted too)."
    Sometimes it lines up with the horizontal axis, sometimes not.
    Aandi Inston
    =====================================================
    "Remember, in PDF, the origin is BOTTOM LEFT... "
    Leonard Rosenthol
    =====================================================
    Thank you, Aandi, Leonard, Thanks a lot
    Jason Wang

  • How to get Adobe PDF to show in Printer dialog

    Hi,
    I just installed CS2 on my new Dell Inspiron laptop with Windows 7.
    I can't get Adobe PDF as an option in the print dialog box. The Acrobat help files have help on how to configure it once it is in there but no guidance on how to get it installed. If I remember correctly it installed as part of Acrobat Professional on my previous Dell Laptop running Windows XP.
    Thanks,

    Acrobat 7 Professional.
    I guess that explains it then.
    Does this mean I will not be able to use any of the functions of Acrobat in Windows 7 of just some?
    Can you recommend a site that might provide more info?
    Thanks

  • How to get back pdf functionality

    I think I deleted something in the Applications folder and now I get the error "AdobePDFViewer cannot find a compatible Adobe Acrobat or Adobe Reader to view this P...". What did I do, and how do I fix it?

    Hi,
    By the sounds of it, you removed Adobe Reader from your system. Your options are either to reinstall Reader from adobe.com or trash the AdobePDFViewer.plugin from /Library/Internet Plug-Ins/ - trashing the plugin file will allow Safari's in-built PDF handler to take over.

Maybe you are looking for

  • Photoshop CS 4 crashes on cooltype.dll and layers dissapear on when clicked on image

    Photoshop CS 4 crashes on cooltype.dll and layers dissapear on when clicked on image as if the photoshop is responding very slowly i found that photoshop crashes when opening existing project and crashes in cooltype font, did reinstall and delete pre

  • Airplay - Apple TV not visible after upgrade to iOS 8.2

    I upgraded my iPhone 6 Plus to iOS 8.2 and Apple TV 2G to the latest update. Now I cannot see Apple TV under Airplay. I made sure that I am on the same Wifi. Please help. Niket

  • Converting XML to string

    I have an xml file titled config.xml that looks like this. <textChanges>      <change id = "22833" whatToAdd = "\n\n" whereToAdd = "Front"></change>      <change id = "22843" whatToAdd = "\n" whereToAdd = "End"></change> </textChanges> I'm processing

  • How to stretch lov in table?

    Hi, i need to stretch LOV in table. i attach examples Please, help.

  • Using 802.1X and non-Cisco IP Phones

    Hi there, Having some questions about an 802.1x/non-Cisco ip phone setup and was hoping to find some answers/user-experience with this setup. Main questions i'm facing: 1) When using non-Cisco ip phones (eg Nortel or Siemens) and a previous authorize