Save JSP file as PDF

I am trying to open a jsp file in pdf format. I set content type = "text/pdf". I am able to save the pdf file. but the content in the pdf file is corrupted and corresponding pdf application is unable to open the file. I am successfully saved the jsp file in excel, word.
I tried with content type = "application/pdf". But it is opening in HTML.
Please help me out
Thanx in advance.
Karun

hi
Thankx for reply
I tried with following code using iText, But how should i generate my HTML content into the PDF
Is there any class to write the html content pdf
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
PdfWriter pdf = PdfWriter.getInstance(document ,
new FileOutputStream("c:\\text.pdf"));
document.setHeader(header);
document.open();
document.add(new Paragraph("This is test message"));
document.close();
I'm successful with above code, but not with my HTML code, 'coz html content is directly priting to pdf, its not parsing
help me plz

Similar Messages

  • Created PDF form in Acrobat XI Pro, but HELP fields disappear when I save FCDT file to PDF. Please help. Thanks!

    Created PDF form in Acrobat XI Pro, but HELP fields disappear when I save FCDT file to PDF. Please help. Thanks!

    I am not aware of a field type "Help" within a PDF form. I do not see it as a form field that can be added in the form edit mode.
    Forms Central forms do not support all the features of Acrobat forms.
    Are you talking about the "Tool Tips" or a hidden field that only shows when one enters a field and is hidden upon exiting the field.

  • How to save a file in PDF

    Hi,
    Iam developing an application where in iam drawing some boxes using Java Graphics.I wanted to save the file as .PDF file.Is it possible to save the file as .PDF file.If so any one has any sample code?Please help me in this regard as its very important for me to do.
    Thanks in advance,
    Regards,
    Ravi

    Steve, you're amazing. Do you keep a deadbeat
    database or is your memory that good?
                             RIGGS
                   Roger.  Quit looking so damn
                   worried.  I'm fine.
                             MURTAUGH
                   Two inches higher, they would've
                   got your head.
                             RIGGS
                   Fuck that.  Two inches to the left,
                   they would've got my smokes.
         He takes out a pack, lights one up.
                             RIGGS
                   Oh, by the way:  Guy who shot me?
                             MURTAUGH
                   Yeah.
                             RIGGS
                   Same guy who shot Lloyd.
                             MURTAUGH
                   Jesus ... You sure?
                             RIGGS
                   I never forget an asshole.

  • 16.0.4 update now saves "smallest file size" pdf's the same size as "illustrator default"

    16.0.4 update now saves "smallest file size" pdf's the same size as "illustrator default" ...anyone else?
    I have to save the file, open it in acrobat, then resave using "reduced file size"
    this is since I updated to 16.0.4 yesterday I think....there was some update
    what happened?

    I used default setting each time...now that its updated, I cannot compare it to before the date
    can anyone check these settings?

  • Unable to Save AI files as PDF's in Illustrator CS 4

    I am having problems saving my ai files as PDF's in Illustrator CS 4. I was working fine the other day. I save as PDF and the PDF saving dialogue box doesn't show up and I'm unable to click on anyhing until I hit the "escape" key. I have installed all my Adobe updates but still no success. Does anyone have any suggestions on how to fix this problem?
    Thank you very much.

    Dude you were spot on...I use two monitors when at home and for some reason the dialogue box won't pop up on screen just when I'm using my laptop.  Thanks for your reply...it was driving my crazy

  • In CS2, how can I save a file as PDF 9.0+?

    Hi everyone,
    I use Illustrator CS2 and when I save a file in CS2 (Save As) as a PDF i can only save it as an Acrobat Reader 4, 5, 6, or 7.0 file.
    Is there a way to save a CS2 .ai file as an Acrobat Reader 9.0+ file while in Illustrator CS2??
    Thanks in advance!

    If  you have acrobat in a newer version you could file >> reduce file size
    Otherwise you coudl print to .ps file and upload that to an Online service to makes PDFs
    https://www.acrobat.com/createpdf/en/home.html

  • Can't save Illustrator file to PDF

    I am just trying to save a PDF from my illustrator file. However, when I go to Save as, and select PDF, no dialog box opens to allow me to set how I want the file outputted. IF I just hit enter, the file does save.. its just like the Dialog box is hidden or not appearing. The reason I need the dialog box is because I need to add bleeds to the PDF and my default save doesn't do that. Any ideas or anyone else have this problem? Thanks

    An addition to this issue. I had the exact thing going on, but did have my second monitor running and still no dialog box. The issue was that I switched desks and now had my extra monitor on the other side of my laptop. So, after much frustration, finally figured out to go to preferences > displays, changed the arrangement to put the monitor back to the other side and "whallaa..." there it was.

  • Programmatically save xls file as pdf

    Using Microsoft Report Generation Toolkit to create report.
    Client wants pdf file not xls file.
    Suggestions for programmatically saving xls file as pdf.
    Solved!
    Go to Solution.

    markfranklin,
    Sorry I did make some assumptions there. I had a look at the low-level code for the Print Report VI and can't figure out a way to modify it to do what you want. Like Coq Rouge said, it would require a pdf printer driver for optimal integration. I did however find a third party PDF Toolkit by Simplicity AI which may suit your needs. It was coded for LabVIEW 8.6 and is available for free download from: http://www.simplicityai.co.uk/products_services/products/pdftoolkit/
    I hope this will be of use.
    Regards,
    Imtiaz Chowdhury
    Head of Digital Technologies
    Brand786

  • Do you know how to save Pages file into PDF?

    Using Pages on iPad I'd like to save what I write into PDF file in order to share it with my friends. Unfortunately I don't see how to do that.
    Even when I send this file via email as a PDF again it is not an attachment but it becomes body of the email itself
    Do you heve any suggestion?
    Appreciate any help on this
    Best Regards and Ciao
    Roberto

    Also, if you're using VB.NET, this is pretty easy ... something like this would work:
    Private Shared Function BitBlt( _
    ByVal hdcDest As IntPtr, _
    ByVal nXDest As Integer, _
    ByVal nYDest As Integer, _
    ByVal nWidth As Integer, _
    ByVal nHeight As Integer, _
    ByVal hdcSrc As IntPtr, _
    ByVal nXSrc As Integer, _
    ByVal nYSrc As Integer, _
    ByVal dwRop As Integer _
    ) As Boolean
    End Function
    Private Shared SRCCOPY As Integer = &HCC0020
    Private Sub SaveFormToFile(ByVal sourceForm As Form, ByVal filename As String)
    Dim formGraphics As Graphics = sourceForm.CreateGraphics()
    Dim
    bufferRect = sourceForm.ClientRectangle
    Dim buffer As Image = New Bitmap(bufferRect.Width, bufferRect.Height, formGraphics)
    Dim bufferGraphics As Graphics = Graphics.FromImage(buffer)
    Dim formDC As IntPtr = formGraphics.GetHdc()
    Dim bufferDC As IntPtr = bufferGraphics.GetHdc()
    BitBlt(bufferDC, 0, 0, bufferRect.Width, bufferRect.Height, formDC, 0, 0, SRCCOPY)
    bufferGraphics.ReleaseHdc(bufferDC)
    formGraphics.ReleaseHdc(formDC)
    bufferGraphics.Dispose()
    formGraphics.Dispose()
    buffer.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg)
    buffer.Dispose()
    End Sub
    If you copied and pasted this to your form, you could then save the form to a .jpg file anytime you want by passing the Me reference in for this first parameter and the filename that you want to save it to. For example, if you wanted to create a .jpg file in the root directory of your C drive called "Test.jpg":
    SaveFormToFile(Me, "Test.jpg")
    - Elton

  • When I save a file as .pdf, why does it open blank?

    Why are the files I save as .pdf turn up blank?

    Hi Catalina,
    I'd like to assist!
    Are you adding the .pdf extension to existing files?
    Let me know.
    Kind regards, Stacy

  • How to i repair a printer not activated, error code -30 message when trying to save a file to pdf

    Please help

    Hi,
    Thank you for posting in Windows Server Forum.
    Yeah, agree with Milos. Please provide more information for further troubleshooting. 
    From your initial subject it seems you are facing issue with printer activation on your server. The error may be caused if the wrong printer is set as the default printer, the printer driver is missing, or if there are conflicts in the device manager. Please
    make sure below 3 steps whether it’s get some workaround.
    Step one: Make sure the desired printer is set as the default printer 
    Step two: Re-install the USB Composite Device from Device Manager  
    Step three: Reinstall the Software for that particular printer
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How To Save JSP Page As Excel File.

    Dear Friends,
    I am working on a project which has oracle as backend. I have some reports in my project.(.jsp files)I want to save it in MsExcel format.
    How could i do it?
    Also is it possible to save jsp files (the output genrated by jsp) in MS Word,PDF format?
    Sameer.

    If you set the content type and are using IE then the HTML will be rendered in Excel in place. Other browsers open Excel, but not in place.
    If you need more info search google for 'java setcontenttype excel':
    <% response.setContentType("application/vnd.ms-excel"); %>Also a much easier and flexible way to create html from ResultSets is to use my free FormattedDataSet API. The following one line would replace all the lines you posted (and the ones you didn't such as opening the Connection, Statement and ResultSet).
    FormattedDataSet fds=FormattedDataSet.createInstance();
    String html=fds.getFormattedDataSet("select * from table", "htmlTable");steve - http://www.fdsapi.com - The easiest most flexible way of generating dynamic HTML and XML.
    The following would be replaced.
    <table>
    <tr> <th>Name</th> <th>Employee No</th></tr>
    <tr>
    <%
    while (rs.next())
    %>
    <td><%=rs.getString(1) %>
    </td>
    <td><%=rs.getString(2) %>
    </td>
    <%
    %>
    </tr>
    </table>
    **

  • Using PhotoShop CC v2014.1.0 I can't save files as PDFs - I get a program error

    I have tried a couple of different files now. In the past I could save my files as PDF copies, but just recently it has been generating errors. I thought the first one was due to the size of the file but I just tried it again on a small file with the same "program error".

    So the question then becomes, what do the files that won't save as PDF have in common but at the same time they don't share with other files.
    And when I said that a font would cause the issue, this was in regards to using a specific font. Generally one that is corrupt in some fashion or was poorly created. First, try the steps here: Troubleshoot fonts | Photoshop CC, CS6, CS5

  • Can't save Publisher file correctly as PDF

    I have always been able to save Publsiher files as PDF files w/o any problem.  Just recently, my Publsiher documents, when saved as a PDF file,  have been saving only half of each page on a two page spread. The right side of the left page and the left side of the right page are shown in the PDF document and I cannot figure out how to solve this problem. PLEASE help.  I need to send the file to other members of my group and they cannot view the file correctly.
    Thank you!

    Not sure why you ask in the Adobe Reader forum; I would think the problem is on the MS Publisher side?

  • Cannot Save Word files as a PDF in Office 2013 with Office customization tool

    Hello
    I'm deploying office 2013 as a part of a post clone task.  Using the customization tool I created an msp with the full installation (without outlook,Link, or skydrive) I noticed that I cannot save or export files as PDF files.  If I do a manual
    install (without MSP) I can save files as pdf.  I can't find anywhere in the customization tool that allows me to choose different "save as" file types. In office 2010 I used to be able to save word files as PDF files.  Any ideas would
    be greatly appreciated.
    Charles

    Hi,
    In regarding the issue, could you give me more information? Did you test to install the Office 2013 by using MSP and manual installation in the same computer? Did the other Office suits can not save files as pdf?
    Let's do some test to narrow down the issue:
    If you use the only one computer to test, please export a new MSP file include all the suits and use the all the default setting. Then we follow the
    link to deploy again.
    If the issue still exists, please try to change a computer, and update Adobe programs to install the new MSP file to test.
    If you get some error message when you save as pdf through Word, please upload, I'll do more deeply research.
    Regards,
    George Zhao
    TechNet Community Support

Maybe you are looking for