Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7533313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:41:42+00:00 2026-05-30T05:41:42+00:00

I have a Vaadin application and I am trying to display a PDF which

  • 0

I have a Vaadin application and I am trying to display a PDF which I am reading from locally as a PDF stored on my web server.

        setCaption(mainApp.getMsg("app.subwindow.help.title"));
    setHeight("750px");
    setWidth("1000px");
    setModal(true);
    setDraggable(false);
    setResizable(false);
    setBorder(Window.BORDER_MINIMAL);
    setScrollable(true);

    VerticalLayout vl = new VerticalLayout();
    vl.setSpacing(true);    
    vl.setSizeFull();

    Embedded pdf = new Embedded("test", new StreamResource(new StreamSource() {     
            public InputStream getStream() {
                InputStream is = PdfWindow.class.getClassLoader().getResourceAsStream("Lifestyle-Tracker-Promo.pdf");
                return is;
            }
        }, "file.pdf", mainApp));       

    pdf.setType(Embedded.TYPE_BROWSER);
    pdf.setMimeType("application/pdf"); 

    pdf.setSizeFull(); 
    vl.addComponent(pdf);   

    addComponent(vl);

I am trying to display the PDF in a embedded PDF reader on the page. The code works fine with IE8 and Firefox but it refuses to play nice with Chrome’s embedded PDF reader. Has anyone else encountered this issue and has any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:41:42+00:00Added an answer on May 30, 2026 at 5:41 am

    Try setting the content to full, did you try setting your vertical layout as the window’s content?

    Window window = new Window();
            ((VerticalLayout) window.getContent()).setSizeFull();
    
    Embedded pdf = new Embedded("test", new StreamResource(new StreamSource() {     
                public InputStream getStream() {
                    InputStream is = PdfWindow.class.getClassLoader().getResourceAsStream("Lifestyle-Tracker-Promo.pdf");
                    return is;
                }
            }, "file.pdf", mainApp));   
    
    pdf.setType(Embedded.TYPE_BROWSER);
    pdf.setMimeType("application/pdf"); 
    pdf.setSizeFull();
    
    window.addComponent(pdf);
    getMainWindow().addWindow(window);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Vaadin. I have created template for my web application in
I have an Application which displays a Chart, which is filled with data from
I have a vaadin application and I am trying to provide some REST Urls
I have been trying to build a modular web application. My requirements are to
I have created a simple java web (Vaadin) application project using JPA and it
In Vaadin's website it says that only Eclipse and NetBeans have fully functional (which
I am trying to create a UI for a java web app using Vaadin.
This may be an incredibly stupid question, but I have a web application that
I have developed a vaadin application for a friend of me. Now I want
I have a download action implemented on my Vaadin application but for some reason

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.