How to force TCPDF to only generate one / first page?I have two problems about tcpdfTCPDF very slow generation of dynamic arabic PDFWhat is the most efficient way to create large PDFs with TCPDF?HTML Rendering with TCPDF(PHP)PDF Output varies by browserTCPDF Library in Joomla. Table exceeds page width?Redirect after output completed and file saved (not sure how to know when large PDF's fully saved)Tcpdf using special letters in function OUTPUTTCPDF produces “An error exists on this page.” in Acrobat with PNGs

At what point in European history could a government build a printing press given a basic description?

Should breaking down something like a door be adjudicated as an attempt to beat its AC and HP, or as an ability check against a set DC?

Why do they consider the Ori false gods?

Why is this Simple Puzzle impossible to solve?

What is the largest (size) solid object ever dropped from an airplane to impact the ground in freefall?

How strong are Wi-Fi signals?

What is the most important source of natural gas? coal, oil or other?

How to make a crossed out leftrightarrow?

Under what law can the U.S. arrest International Criminal Court (ICC) judges over war crimes probe?

What do different value notes on the same line mean?

Is CD audio quality good enough for the final delivery of music?

What are these arcade games in Ghostbusters 1984?

Infinite Sequence based on Simple Rule

Array Stutter Implementation

Full backup on database creation

Command to Search for Filenames Exceeding 143 Characters?

Employer asking for online access to bank account - Is this a scam?

Forward and backward integration -- cause of errors

How bitcoin nodes update UTXO set when their latests blocks are replaced?

Where is the logic in castrating fighters?

Does this degree 12 genus 1 curve have only one point over infinitely many finite fields?

Is there a benefit to having both truesight and darkvision?

Rests in pickup measure (anacrusis)

What is the 中 in ダウンロード中?



How to force TCPDF to only generate one / first page?


I have two problems about tcpdfTCPDF very slow generation of dynamic arabic PDFWhat is the most efficient way to create large PDFs with TCPDF?HTML Rendering with TCPDF(PHP)PDF Output varies by browserTCPDF Library in Joomla. Table exceeds page width?Redirect after output completed and file saved (not sure how to know when large PDF's fully saved)Tcpdf using special letters in function OUTPUTTCPDF produces “An error exists on this page.” in Acrobat with PNGs






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am generating a PDF from a web form for submitting abstracts. The form has fields like title, text, references etc. I want to force TCPDF to only generate one / first page so that I can force users to write short abstracts. Right now it generates as many pages as it needs to display all content.



// Include the main TCPDF library (search for installation path).
require_once('tcpdf_path');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('conf_title');
$pdf->SetTitle('title');
$pdf->SetSubject('conf_title Abstracts');
$pdf->SetKeywords('conf_title, Abstract');

// set default header data
$pdf->SetHeaderData('','', '', 'conf_title');
$pdf->setPrintHeader(true);

// set header and footer fonts
$pdf->setHeaderFont(Array('freeserif', '', 8));

// set margins
$pdf->SetMargins(20, 15, 20);


// set line height
$pdf->setCellHeightRatio(0.7);

// set image scale factor
$pdf->setImageScale(1.5);

// }

// ---------------------------------------------------------

// set font
$pdf->SetFont('freeserif', '', 11);

// add a page
$pdf->AddPage();

/* NOTE:
* *********************************************************
* You can load external XHTML using :
*
* $html = file_get_contents('/path/to/your/file.html');
*
* External CSS files will be automatically loaded.
* Sometimes you need to fix the path of the external CSS.
* *********************************************************
*/

// define some HTML content with style
$html = <<<EOF
<!-- html goes here - I've removed it for the question -->
EOF;

// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');

// reset pointer to the last page
$pdf->lastPage();

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('pdf_entry_id.pdf', 'I');
exit;
//============================================================+
// END OF FILE
//============================================================+
?>









share|improve this question






















  • I can set $pdf->SetAutoPageBreak(FALSE, 100) where 100 is PDF_MARGIN_BOTTOM but I am not sure if that is the proper way to do it and also it completely ignores 100 as PDF_MARGIN_BOTTOM - it breaks the page right on the edge.

    – Evangelos Papadakis
    Mar 24 at 7:17

















0















I am generating a PDF from a web form for submitting abstracts. The form has fields like title, text, references etc. I want to force TCPDF to only generate one / first page so that I can force users to write short abstracts. Right now it generates as many pages as it needs to display all content.



// Include the main TCPDF library (search for installation path).
require_once('tcpdf_path');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('conf_title');
$pdf->SetTitle('title');
$pdf->SetSubject('conf_title Abstracts');
$pdf->SetKeywords('conf_title, Abstract');

// set default header data
$pdf->SetHeaderData('','', '', 'conf_title');
$pdf->setPrintHeader(true);

// set header and footer fonts
$pdf->setHeaderFont(Array('freeserif', '', 8));

// set margins
$pdf->SetMargins(20, 15, 20);


// set line height
$pdf->setCellHeightRatio(0.7);

// set image scale factor
$pdf->setImageScale(1.5);

// }

// ---------------------------------------------------------

// set font
$pdf->SetFont('freeserif', '', 11);

// add a page
$pdf->AddPage();

/* NOTE:
* *********************************************************
* You can load external XHTML using :
*
* $html = file_get_contents('/path/to/your/file.html');
*
* External CSS files will be automatically loaded.
* Sometimes you need to fix the path of the external CSS.
* *********************************************************
*/

// define some HTML content with style
$html = <<<EOF
<!-- html goes here - I've removed it for the question -->
EOF;

// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');

// reset pointer to the last page
$pdf->lastPage();

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('pdf_entry_id.pdf', 'I');
exit;
//============================================================+
// END OF FILE
//============================================================+
?>









share|improve this question






















  • I can set $pdf->SetAutoPageBreak(FALSE, 100) where 100 is PDF_MARGIN_BOTTOM but I am not sure if that is the proper way to do it and also it completely ignores 100 as PDF_MARGIN_BOTTOM - it breaks the page right on the edge.

    – Evangelos Papadakis
    Mar 24 at 7:17













0












0








0








I am generating a PDF from a web form for submitting abstracts. The form has fields like title, text, references etc. I want to force TCPDF to only generate one / first page so that I can force users to write short abstracts. Right now it generates as many pages as it needs to display all content.



// Include the main TCPDF library (search for installation path).
require_once('tcpdf_path');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('conf_title');
$pdf->SetTitle('title');
$pdf->SetSubject('conf_title Abstracts');
$pdf->SetKeywords('conf_title, Abstract');

// set default header data
$pdf->SetHeaderData('','', '', 'conf_title');
$pdf->setPrintHeader(true);

// set header and footer fonts
$pdf->setHeaderFont(Array('freeserif', '', 8));

// set margins
$pdf->SetMargins(20, 15, 20);


// set line height
$pdf->setCellHeightRatio(0.7);

// set image scale factor
$pdf->setImageScale(1.5);

// }

// ---------------------------------------------------------

// set font
$pdf->SetFont('freeserif', '', 11);

// add a page
$pdf->AddPage();

/* NOTE:
* *********************************************************
* You can load external XHTML using :
*
* $html = file_get_contents('/path/to/your/file.html');
*
* External CSS files will be automatically loaded.
* Sometimes you need to fix the path of the external CSS.
* *********************************************************
*/

// define some HTML content with style
$html = <<<EOF
<!-- html goes here - I've removed it for the question -->
EOF;

// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');

// reset pointer to the last page
$pdf->lastPage();

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('pdf_entry_id.pdf', 'I');
exit;
//============================================================+
// END OF FILE
//============================================================+
?>









share|improve this question














I am generating a PDF from a web form for submitting abstracts. The form has fields like title, text, references etc. I want to force TCPDF to only generate one / first page so that I can force users to write short abstracts. Right now it generates as many pages as it needs to display all content.



// Include the main TCPDF library (search for installation path).
require_once('tcpdf_path');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('conf_title');
$pdf->SetTitle('title');
$pdf->SetSubject('conf_title Abstracts');
$pdf->SetKeywords('conf_title, Abstract');

// set default header data
$pdf->SetHeaderData('','', '', 'conf_title');
$pdf->setPrintHeader(true);

// set header and footer fonts
$pdf->setHeaderFont(Array('freeserif', '', 8));

// set margins
$pdf->SetMargins(20, 15, 20);


// set line height
$pdf->setCellHeightRatio(0.7);

// set image scale factor
$pdf->setImageScale(1.5);

// }

// ---------------------------------------------------------

// set font
$pdf->SetFont('freeserif', '', 11);

// add a page
$pdf->AddPage();

/* NOTE:
* *********************************************************
* You can load external XHTML using :
*
* $html = file_get_contents('/path/to/your/file.html');
*
* External CSS files will be automatically loaded.
* Sometimes you need to fix the path of the external CSS.
* *********************************************************
*/

// define some HTML content with style
$html = <<<EOF
<!-- html goes here - I've removed it for the question -->
EOF;

// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');

// reset pointer to the last page
$pdf->lastPage();

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('pdf_entry_id.pdf', 'I');
exit;
//============================================================+
// END OF FILE
//============================================================+
?>






php pdf tcpdf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 7:12









Evangelos PapadakisEvangelos Papadakis

1




1












  • I can set $pdf->SetAutoPageBreak(FALSE, 100) where 100 is PDF_MARGIN_BOTTOM but I am not sure if that is the proper way to do it and also it completely ignores 100 as PDF_MARGIN_BOTTOM - it breaks the page right on the edge.

    – Evangelos Papadakis
    Mar 24 at 7:17

















  • I can set $pdf->SetAutoPageBreak(FALSE, 100) where 100 is PDF_MARGIN_BOTTOM but I am not sure if that is the proper way to do it and also it completely ignores 100 as PDF_MARGIN_BOTTOM - it breaks the page right on the edge.

    – Evangelos Papadakis
    Mar 24 at 7:17
















I can set $pdf->SetAutoPageBreak(FALSE, 100) where 100 is PDF_MARGIN_BOTTOM but I am not sure if that is the proper way to do it and also it completely ignores 100 as PDF_MARGIN_BOTTOM - it breaks the page right on the edge.

– Evangelos Papadakis
Mar 24 at 7:17





I can set $pdf->SetAutoPageBreak(FALSE, 100) where 100 is PDF_MARGIN_BOTTOM but I am not sure if that is the proper way to do it and also it completely ignores 100 as PDF_MARGIN_BOTTOM - it breaks the page right on the edge.

– Evangelos Papadakis
Mar 24 at 7:17












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321504%2fhow-to-force-tcpdf-to-only-generate-one-first-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321504%2fhow-to-force-tcpdf-to-only-generate-one-first-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript