Sign In  Sign Up Live-Chat

Filling PDF form in Memory and displaying in browser

Last post 03-06-2007, 6:34 PM by ken. 19 replies.
Page 1 of 2 (20 items)   1 2 Next >
Sort Posts: Previous Next
  •  02-21-2007, 6:25 PM 68420

    Filling PDF form in Memory and displaying in browser

    Hi There,

    I am evaluating your product and was wondering if it is possible to fill an instance of a pdf form (that is stored on disk) in memory with data from a database and then display the flattened form in a browser on the fly. I looked at your WIKI and see how to store it back to disk as a new pdf but not how to create it in memory (without saving a new version to disk) and then display it in a browser.

    Thanks for your help.

    -Tom

     
  •  02-21-2007, 8:32 PM 68433 in reply to 68420

    Re: Filling PDF form in Memory and displaying in browser

    Hi Tom,

    Thanks for considering Aspose.

    You could refer to the demo about how to fill form in momery and display in IE.
    A simple demo is this :http://www.aspose.com/Products/Aspose.Pdf.kit/Demos/default.aspx?index=FillFields .
    A more complete demo is this (including how to fill the form directly from the database) :
    http://www.aspose.com/Products/Aspose.Pdf.kit/Demos/Northwind.aspx .

    Best regards.

    Ken Du
    Lead Developer
    Aspose Changsha Team
    Contact Us
     
  •  02-22-2007, 10:07 AM 68509 in reply to 68433

    Re: Filling PDF form in Memory and displaying in browser

    Thanks Ken! I am getting a 404 error (Page Not Found) for the following link:

    http://www.aspose.com/Products/Aspose.Pdf.kit/Demos/Northwind.aspx?index=MailMergeStream

    Also, the first link of the demo you gave me shows the final PDF but is there a way to see the code that created the demo in C#.

    Thanks,

    Tom

     
  •  02-22-2007, 12:15 PM 68531 in reply to 68509

    Re: Filling PDF form in Memory and displaying in browser

    Nevermind - I found the demos code - it was part of the installation.

    Thanks,

    -TQ

     
  •  02-23-2007, 11:29 AM 68678 in reply to 68531

    Re: Filling PDF form in Memory and displaying in browser

    I have another question for you. I looked at the demo but I am having a problem getting the pdf to be displayed in the browser. When I run the code in IE 7, it only allows me to save the resulting pdf, not open it in the browser. When I run it in Fire Fox 2, it displays the binary code in the browser.

    This is the code from the demo:

    templatePdf = path + @".\Resources\student.pdf";

    Response.AddHeader("content-disposition","inline; filename=" + "studentOut.pdf");

    FormDemos.FillFields(path,templatePdf, Response.OutputStream);

    Response.End();

    Is there a way to get it to display in the browser in IE and Firefox?

    Thanks,

    Tom

     
  •  02-23-2007, 7:27 PM 68726 in reply to 68678

    Re: Filling PDF form in Memory and displaying in browser

    Hi, Tom,
    An option of Adobe Reader needs setting. It is "Edit->Preferences->Internet->display the pdf in browser". Select the option and test it.

    Any other question is welcome.

    Best regards.

    Ken Du
    Lead Developer
    Aspose Changsha Team
    Contact Us
     
  •  02-26-2007, 11:37 AM 68864 in reply to 68726

    Re: Filling PDF form in Memory and displaying in browser

    Hi Ken,

    I checked the setting in Adobe Reader 8.0 and it is correctly set to display in the browser but I am still getting the situation I descriped earlier - in IE it will give me a dialog box to save the pdf but won't display and in FireFox it displays the binary code.

    FYI - when I run the demo code on your site (http://www.aspose.com/Products/Aspose.Pdf.kit/Demos/) for Fill Fields (#9) I get the same result.

    Is there something else I am missing? Is there a way to take the instantiated Form object and create a PDF object, so I can use the save method of the PDF object and use the SaveType property to get it to display in the browser?

    Thanks,

    Tom

     
  •  02-26-2007, 7:31 PM 68901 in reply to 68864

    Re: Filling PDF form in Memory and displaying in browser

    Hi,

    Please try clicking the following link:

    http://illiad.evms.edu/sample.pdf

    This pdf should open in your browser. If not then there is a problem with your Acrobat Reader installation. Please consider reinstalling Acrobat reader.

    Thanks.

     
  •  02-27-2007, 10:45 AM 68966 in reply to 68901

    Re: Filling PDF form in Memory and displaying in browser

    Hi Adeel,

    The document in the link does load in my browser. Acrobat 8 is installed correctly on my machine. I still have the issue when I run the Fill Fields demo - in IE 7 I get a pop-up box that only allows me to save the PDF to disk (it does not load the pdf in the browser) and in FireFox 2 it loads the binary version of the pdf into the browser.

    Is there some other setting I am missing?

    Thanks,

    Tom

     

     
  •  02-27-2007, 1:18 PM 68983 in reply to 68966

    Re: Filling PDF form in Memory and displaying in browser

    Try adding this line after you set your Response header info:

    Response.ContentType = "application/pdf";

     
  •  02-27-2007, 2:59 PM 68992 in reply to 68983

    Re: Filling PDF form in Memory and displaying in browser

    Thanks anotaro! It now loads correctly in IE 7. I am still having problems loading it in Firefox 2. It no longer displays the binary version of the document but seems to freeze up the browser.

    Is there some code or setting I need to get this to work in Firefox 2?

    Thanks,

    Tom

     
  •  02-27-2007, 3:24 PM 68995 in reply to 68992

    Re: Filling PDF form in Memory and displaying in browser

    You may just need to update or install the adobe plug-in for firefox...not sure, though.  Good luck...

     
  •  02-27-2007, 8:37 PM 69031 in reply to 68995

    Re: Filling PDF form in Memory and displaying in browser

    Hi,

    If you were unable to view the pdf that I posted then it means acrobat reader isn't installed properly. By this I mean the plugin is not cofigured correctly with IE and other browsers that you may have. The simplest solution is to uninstall reader and install it again. Have you tried this ?

    Thanks.

     
  •  02-28-2007, 11:52 AM 69132 in reply to 69031

    Re: Filling PDF form in Memory and displaying in browser

    Hi Adeel,

    As I stated in an earlier post, I was able to view the pdf that you posted (http://illiad.evms.edu/sample.pdf) in both IE and Firefox. Acrobat is installed correctly in both browsers on my machine.

    The problem I am having is that when I run the Fill Fields (#9) demo on(http://www.aspose.com/Products/Aspose.Pdf.kit/Demos/) in Firefox 2, it is displaying the binary code for the pdf instead of displaying the actual document. I also tested this in Firefox 2 on a different machine and had the same issue. In IE 7, it displays a pop-up box that allows me to save the pdf to disk but does not let me load it into the browser.

    I fixed the problem in IE 7 (it now loads correctly in the browser) by adding the code that anotaro suggested above:

    Response.ContentType = "application/pdf";

    However, this did not fix the problem in FireFox 2. Instead of displaying the binary version of the document, it now freezes up the browser and does not diplay the pdf.

    I am wondering if anyone else has had problems with Firefox and if there is anyway to fix this?

    Thanks,

    Tom

     
  •  02-28-2007, 7:35 PM 69168 in reply to 69132

    Re: Filling PDF form in Memory and displaying in browser

    Hi, Tom, I have solved this problem. It needs to set more options about the "Response" in codes since the firefox is not very compatible with the IE and VS.

    Please change the code of the demo about the fillfield (in default.aspx.cs) like this:

    case "FillFields":
                        templatePdf = path + @".\Resources\student.pdf";
                    //    Response.AddHeader("content-disposition","inline; filename=" + "studentOut.pdf");

                        //response to user's web.
                        Response.Expires = 0;
                        Response.Buffer = true;
                        Response.ClearContent();
                        Response.AddHeader("content-disposition","inline; filename=" + "studentOut.pdf");
                        Response.ContentType = "application/pdf";
                   
                        FormDemos.FillFields(path,templatePdf, Response.OutputStream);
                        Response.End();
                        break;


    Best regards.

    Ken Du
    Lead Developer
    Aspose Changsha Team
    Contact Us
     
Page 1 of 2 (20 items)   1 2 Next >
View as RSS news feed in XML