pdf-generation

All columns of excelsheet are not fitted in same page of pdf; while converting using Excel VBA

天大地大妈咪最大 提交于 2019-11-29 04:29:13
Am trying to convert microsoft excel file with large number of columns (70+) into pdf using a Excel VBA code. In active workbook, am trying to save 'Sheet1' to PDF format at required path. I have the following code. Sub GetSaveAsFilename() Dim fileName As String fileName = Application.GetSaveAsFilename(InitialFileName:="", _ FileFilter:="PDF Files (*.pdf), *.pdf", _ Title:="Select Path and FileName to save") If fileName <> "False" Then With ActiveWorkbook .Worksheets("Sheet1").ExportAsFixedFormat Type:=xlTypePDF, fileName:= _ fileName, Quality:=xlQualityStandard, _ IncludeDocProperties:=True,

Generating PDF in .NET using XSL-FO

有些话、适合烂在心里 提交于 2019-11-29 04:01:40
I need to generate a pdf in .NET using XSL-FO. There are no shortage of libraries to do this. What library would you suggest that I use and why? This is an old question, I know, but none of the answers to date actually addressed the OP QUESTION. She asked for options for using XSL-FO, not "how to generate PDF using code?". The primary non-commercial answer on the actual question is: Apache.org Project's FOP Formatting Objects Processor. It takes XSL-FO compliant xsl code and xml and generates PDF files according to the XSL-FO spec. There are several other commercial options: Ibex PDF Creator

How can I merge PDF files (or PS if not possible) such that every file will begin in a odd page?

浪尽此生 提交于 2019-11-29 01:53:14
I am working on a UNIX system and I'd like to merge thousands of PDF files into one file in order to print it. I don't know how many pages they are in advance. I'd like to print it double sided, such that two files will not be on the same page. Therefore it I'd the merging file to be aligned such that every file will begin in odd page and a blank page will be added if the next place to write is an even page. Here's the solution I use (it's based on @Dingo's basic principle, but uses an easier approach for the PDF manipulation): First, I create a PDF file with a single blank page somewhere, e.g

iTextSharp creation of a pdf from a list of byte arrays

 ̄綄美尐妖づ 提交于 2019-11-29 01:26:01
I've got a list of byte[] which i'd like to concatenate into one byte[] which will be the final PDf. On the "page = copy.GetImportedPage(new PdfReader(p), i); " i'm getting an "object reference not set to an instance error. I've got no clue of what's going on, i've already checked every object and there's no null. Any ideas on this, or another piece of code that could make the trick?! I've got this method: EDIT public static byte[] concatAndAddContent(List<byte[]> pdf) { byte [] todos; using(MemoryStream ms = new MemoryStream()) { Document doc = new Document(); doc.Open(); PdfCopy copy = new

Changing or eliminating Header & Footer in TCPDF

南楼画角 提交于 2019-11-29 00:58:25
AddPage() in tcpdf automatically calls Header and Footer. How do I eliminate/override this? Brian Showalter Use the SetPrintHeader(false) and SetPrintFooter(false) methods before calling AddPage() . Like this: $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', true, 'UTF-8', false); $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->AddPage(); A nice easy way to have control over when to show the header - or bits of the header - is by extending the TCPDF class and creating your own header function like so: class YourPDF extends TCPDF { public function Header() { if (count(

Keep table in one piece MigraDoc / PDFsharp

倖福魔咒の 提交于 2019-11-29 00:57:48
问题 I am using PDFsharp / MigraDoc to write tables and charts to PDF files. This worked great so far, however MigraDoc will always split my tables (vertically) when it should move the whole table to the next page in the document. How do I make sure the table will stay in one piece? Table class of MigraDoc.DocumentObjectModel.Tables has a bool KeepTogether property however it seems to have no effect (either set to true or false). Is there a way to do it manually? Is there any way to "measure" the

How to create a password protected pdf file

女生的网名这么多〃 提交于 2019-11-29 00:43:10
I'm using html2fpdf for creating PDF documents. Now once I have created that, I want to make sure that the PDF file is password protected. How can this be done in PHP? Mohit Jain Download the library I am using from a blog post on the ID Security Suite site : <?php function pdfEncrypt ($origFile, $password, $destFile){ require_once('FPDI_Protection.php'); $pdf =& new FPDI_Protection(); $pdf->FPDF('P', 'in'); //Calculate the number of pages from the original document. $pagecount = $pdf->setSourceFile($origFile); //Copy all pages from the old unprotected pdf in the new one. for ($loop = 1; $loop

How to calculate width and height of text in jspdf?

只愿长相守 提交于 2019-11-28 23:13:25
I'm facing some issues while creating tables in jspdf . I could not find any good related docs, but if anyone knows one, please share. I found two related methods: 1) doc.getStringUnitWidth(text, {widths:12,kerning:2}); 2) doc.getTextDimensions(text) What does widths and kerning mean in the first method? What should I provide? Which method should I use to get the width and height of text? My goal is to solve some issues related to overlapping cell content, wrapping of text and text overflow relative to the page width. You might want to look at the AutoTable plugin for generating tables with

Maintain CSS styling when converting HTML to PDF in ASP.NET [closed]

天涯浪子 提交于 2019-11-28 21:59:49
I am using ITextSharp to convert an HTML page to PDF. However, ITextSharp prints the CSS in the STYLE declaration straight out, ignores stylesheets even when added programmatically and only listens to some inline styles (e.g. font-size and color but not background-color ). Is there something I am missing with ITextSharp, or is there a better (and free) way of doing this conversion? Thanks in advance, Have a look at WKHTMLTOPDF. It is open source, based on webkit and free. We wrote a small tutorial here . Mauricio Scheffer HTML / CSS support in iText / iTextSharp is very basic . It's just not

How do I create a PDF file, including images and text, from Python? [closed]

两盒软妹~` 提交于 2019-11-28 21:23:31
I am looking for a way to create a sheet of labels, as a PDF file, from a Python program. Each label has one or two images, and a few lines of text (same font, e.g. Helvetica or Arial, but possibly different sizes, and using bold and italic). These being labels, it is important that the elements are positioned correctly on the page. Some of the labels are addresses, so the text can vary and have different line lengths and number of lines. I would like to be able to tell when text did not fit in the space available for it, so that the program could try a few strategies automatically (e.g.