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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:45:33+00:00 2026-06-11T21:45:33+00:00

I am converting html to PDF. All working well except when there is a

  • 0

I am converting html to PDF. All working well except when there is a long html , having multiple pages. After conversion, its output is displayed in one PDF page, i need auto pagination .Is it supported by mPDF. It works well with all other HTML but not with few am working. I tried to copy my code here , but it was very long so cant put here.

My Html is not valid , I know it.I used HTML purifier to fix it, but its not completely fixed. I read in net that if there are nested tables then this may happens. But i need a solution .

Here is my code.

<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors','Off');
//ini_set("pcre.backtrack_limit","1000000");
ini_set("memory_limit","256M"); 
$html = 'My long invalid HTML';


include_once('../htmlpurifier/library/HTMLPurifier.auto.php');
$config = HTMLPurifier_Config::createDefault();
$config->set('Core', 'Encoding', 'UTF-8');
$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional');
$filter = new HTMLPurifier($config);
$html = $filter->purify($html);
include("mpdf.php");
$mpdf=new mPDF('c');
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
  • 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-06-11T21:45:34+00:00Added an answer on June 11, 2026 at 9:45 pm

    The issue is with nested tables. I separated the tables and PDF is now working great

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

Sidebar

Related Questions

I am having a prblem in converting html to pdf The code which i
I am thinking about converting a PDF document into a long scrolling HTML doc
I'm working on a project that involves converting a large amount of HTML content
After converting project to ARC, The converting operation removed all the - assign, retain
I'd like to know if ITextSharp has the capability of converting HTML to PDF.
When converting HTML to a PDF document characters such as é or ñ are
Duplicate: Converting HTML TAG Object to JSON Object Hi, Is there is any Javascript
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having problems converting HTML into regular expressions. I just can't seem to figure
Possible Duplicates: Converting HTML Files to PDF PDF file generation from XML or HTML

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.