pdf

css pdf page - header overlapping with content

♀尐吖头ヾ 提交于 2020-06-27 15:32:08
问题 As we can see from the image my content overlaps with the header image and this is the code I have: <style type="text/css" media="print"> @page { /*size:landscape;*/ @top-center { content: element(header); } @bottom-left { content: element(footer); } } div.header { padding: 10px; position: running(header); } div.footer { display: block; padding: 5px; position: running(footer); } .pagenumber:before { content: counter(page); } .pagecount:before { content: counter(pages); } </style> </head> <div

How to create annotation using PdfSharp to highlight text of existing PDF

人走茶凉 提交于 2020-06-27 12:03:16
问题 I would like know whether it is possible to create an text highlight annotation in an existing PDF using PdfSharp? In the PdfSharp documentation, I see examples of PdfTextAnnotation & PdfRubberStampAnnotation , but did not find sample code for following annotations mentioned in the documentation. PdfLineAnnotation, PdfSquareAnnotation, PdfCircleAnnotation, PdfMarkupAnnotation, PdfHighlightAnnotation, PdfUnderlineAnnotation, PdfSquigglyAnnotation, PdfSoundAnnotation, PdfMovieAnnotation. Are

Want to create a pdf with a form having rectangles as header and paragraph in footer and the sections in the body

Deadly 提交于 2020-06-27 08:18:45
问题 The code I have written till now is below: public class HeaderFooterEvent extends PdfPageEventHelper { @Override public void onStartPage(PdfWriter writer, Document document) { } @Override public void onEndPage(PdfWriter writer, Document document) { addHeader(writer, document); addHeader2(writer, document); addFooter(writer, document); } void addHeader(PdfWriter writer, Document document){ try { PdfContentByte cb = writer.getDirectContent(); // the initial rectangle defines the max size of the

Hanging TuesPechkin after initial conversion

妖精的绣舞 提交于 2020-06-27 08:00:50
问题 I am attempting to create a Web API that can convert a styled HTML file into a PDF. I am using TuesPechkin and have installed my application into IIS (as a 32-bit app: I have modified the application pool to run in 32bit mode). IIS 8.5 is running on Windows Server 2012 R2. PDFConversion class in C#: using System.Drawing.Printing; using System.IO; using TuesPechkin; namespace PDFApi { public class PDFcreator { public void convert(string path, string uri) { IConverter converter = new

Hanging TuesPechkin after initial conversion

萝らか妹 提交于 2020-06-27 07:59:31
问题 I am attempting to create a Web API that can convert a styled HTML file into a PDF. I am using TuesPechkin and have installed my application into IIS (as a 32-bit app: I have modified the application pool to run in 32bit mode). IIS 8.5 is running on Windows Server 2012 R2. PDFConversion class in C#: using System.Drawing.Printing; using System.IO; using TuesPechkin; namespace PDFApi { public class PDFcreator { public void convert(string path, string uri) { IConverter converter = new

Reverse white and black colors in a PDF

人走茶凉 提交于 2020-06-24 07:27:03
问题 Given a black and white PDF, how do I reverse the colors such that background is black and everything else is white? Adobe Reader does it ( Preferences -> Accessibility ) for viewing purposes only in the program. But does not change the document inherently such that the colors are reversed also in other PDF readers. How to reverse colors permanently? 回答1: You can run the following Ghostscript command: gs -o inverted.pdf \ -sDEVICE=pdfwrite \ -c "{1 exch sub}{1 exch sub}{1 exch sub}{1 exch sub

Reverse white and black colors in a PDF

北战南征 提交于 2020-06-24 07:26:39
问题 Given a black and white PDF, how do I reverse the colors such that background is black and everything else is white? Adobe Reader does it ( Preferences -> Accessibility ) for viewing purposes only in the program. But does not change the document inherently such that the colors are reversed also in other PDF readers. How to reverse colors permanently? 回答1: You can run the following Ghostscript command: gs -o inverted.pdf \ -sDEVICE=pdfwrite \ -c "{1 exch sub}{1 exch sub}{1 exch sub}{1 exch sub

Send TCPDF generated pdf with phpmailer

心不动则不痛 提交于 2020-06-23 08:28:26
问题 I am generating a pdf file on the fly without saving it to the disk with: $attachment = $this->pdf->Output('e-tickets.pdf', 'S'); According to TCPDF this should return a string containing the pdf file. But sending it with PHPMailer results in a corrupt file: $mail->AddStringAttachment($attachment, 'e-tickets.pdf', 'base64', 'application/pdf'); I tried the following alternatives (and all possible combinations): $attachment = $this->pdf->Output('e-tickets.pdf', 'E'); $mail->AddStringAttachment(

Can Apache FOP be used to convert an arbitary HTML to PDF?

一笑奈何 提交于 2020-06-23 07:38:11
问题 I have tried to use Apache FOP to convert HTML to PDF. ( HTML -->XHTML--> XSL-FO --> PDF). I used the xhtml2fo.xsl from Antenna House for the xhtml --> XSL-FO conversion. It works for simple html files. It does not work for html files with styling ( via embedded css or by style attribute). A PDF is created but completely unformatted. I am trying to convert HTML file where I do not have much control over the styling/content. Creating an xslt for each html is not practical in my use-case.

dompdf generating PDF in with many blank pages between content

南笙酒味 提交于 2020-06-18 13:16:06
问题 I'm using DOMPDF to generate pdf files from html. PDF file is getting generated but there are many blank pages are appearing in between content. Following is my php code. <?php $html=file_get_contents("views/testnew.html"); // echo $html;die(); $paper_orientation = 'landscape'; ob_start(); require_once("dompdf/dompdf_config.inc.php"); $pdfcontent = $html; $dompdf = new DOMPDF(); $dompdf->set_paper('A4', $paper_orientation); $dompdf->load_html($pdfcontent); $dompdf->render(); // $pdf = $dompdf