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 6884755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:32:56+00:00 2026-05-27T05:32:56+00:00

Is it possible to output a pdf on the fly using: Response.ContentType=Application/pdf I have

  • 0

Is it possible to output a pdf on the fly using:

Response.ContentType="Application/pdf"

I have a table full of php variables that I want to output in the pdf using the method above. How would I create the pdf when the user clicks a button on the website and display the content from the table?

UPDATE:
Using html2pdf I’m getting the following error:

Warning: Cannot modify header information - headers already sent by (output started at /home/medilogi/public_html/v1/wp-content/themes/default/header.php:8) in /home/medilogi/public_html/v1/wp-content/themes/default/html2pdf/_tcpdf_5.0.002/tcpdf.php on line 6122
TCPDF ERROR: Some data has already been output to browser, can't send PDF file

<?php
$content = "test";

require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html2pdf->WriteHTML($content);
$html2pdf->Output('example.pdf');
?>
  • 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-27T05:32:57+00:00Added an answer on May 27, 2026 at 5:32 am

    You need to create the pdf before. This response is used only from browser to parse the content type (open directly the PDF using your PDF reader instead of download it).

    You can use html2pdf or FPDF. Last year I used xslt and apache fop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to output specific JSON data (exported from Firefox bookmarks) using PHP.
I have a method that returns a PDF file using DOMPDF . It sends
Is it possible to merge FDF data with a PDF file using PHP alone?
I want to convert an aspx page to PDF using a component that can
Currently, I have a controller action that outputs a PDF (as a Response.OutputStream.Write() )
Is it possible to clear the output cache of one asp.net web application from
I have a Firefox component for PDF signing that I invoke via Javascript. The
Is it possible to output the following HTML unordered list using recursion. <ul> <li>1
I'm currently using php's imagick to convert some PDF to images - This works
I'm new to mono/iPhone and I'm developing an application that views a PDF document

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.