pdf-generation

Writing Arabic with PDFBOX with correct characters presentation form without being separated

扶醉桌前 提交于 2019-11-27 09:09:38
I'm trying to generate a PDF that contains Arabic text using PDFBox Apache but the text is generated as separated characters because Apache parses given Arabic string to a sequence of general 'official' Unicode characters that is equivalent to the isolated form of Arabic characters. Here is an example: Target text to Write in PDF "Should be expected output in PDF File" -> جملة بالعربي What I get in PDF File -> I tried some methods but it's no use here are some of them: 1. Converting String to Stream of bits and trying to extract right values 2. Treating String a sequence of bytes with UTF-8 &&

Crystal Reports “File Break”

那年仲夏 提交于 2019-11-27 08:57:41
问题 I'm generating a Crystal Reports report which will ultimately need to be split into thousands of pdf files. What would be ideal would be if Crystal Reports had something like a "file break", like a page break, that you could insert into the file at the appropriate places. I will need reasonably fine control over the file names, as well....something like "fileName_{CustomerId}_{CustomerIsLocal}.pdf". I'm presuming a third-party piece of software will probably be needed. Thoughts? TIA. 回答1: I

Saving Base64 encoded PDF with Internet Explorer 10 and below

被刻印的时光 ゝ 提交于 2019-11-27 08:38:19
问题 I have recently started using Bootstrap Table and the export plugin for it. A problem I came across is that the export plugin doesn't work for IE, because the files are output using Data URI, which IE doesn't support (I think I read that IE 11 supports it, but no one in my organization uses IE 11, of course.). The only file types I am interested in exporting are Microsoft office types (Word, Excel) and PDFs. I have created a functioning workaround for the MS files. if

PDFs generated using itextsharp giving error at the time of first print command

余生颓废 提交于 2019-11-27 08:35:41
问题 I am getting below for the first time giving print command. "An error exists on this page. Acrobat may not display the page correctly. please contact the person who created the pdf document to correct the problem". Print out is comming very fine. and Second time print out command not giving any error. Please help me why this error is comming for the first time print. This is part of my code to create PDF PdfContentByte cb = writer.DirectContent; cb.BeginText(); Font NormalFont = FontFactory

Header overlap in iText5

大憨熊 提交于 2019-11-27 08:10:50
问题 I created a header and footer for my PDF document using PdfPTables. I have specified the headers and footers in my PdfPageEventHelper's onStartPage and onEndPage event's respectively. The issue I am facing is while adding a paragraph to my document. When I create a new Paragraph as follows: Paragraph content = new Paragraph("This is a test text"); try{ pdfDocument.add(content); } catch (DocumentException e){ e.printStackTrace(); } The content overlaps with the header. What I need is to set

PDF - Remove White Margins

廉价感情. 提交于 2019-11-27 08:06:51
I would like to know a way to remove white margins from a PDF file. Just like Adobe Acrobat X Pro does. I understand it will not work with every PDF file. I would guess that the way to do it, is by getting the text margins, then cropping out of that margins. PyPdf is preferred. iText finds text margins based on this code: public void addMarginRectangle(String src, String dest) throws IOException, DocumentException { PdfReader reader = new PdfReader(src); PdfReaderContentParser parser = new PdfReaderContentParser(reader); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(RESULT))

iTextSharp Password Protected PDF

与世无争的帅哥 提交于 2019-11-27 07:41:29
The following question and answer on StackOverflow show how to generate a PDF that cannot be opened without the appropriate password. Password protected PDF using C# I would like to use this framework similarly, but slightly altered to allow my users to "open" the PDF without needing the password, but only allow them to EDIT the PDF if they have the password. Is that possible with iTextSharp? if this matters, I am working in C# 4.0 within a WF 4.0 custom activity. Yes, there are two passwords that you can pass to PdfEncryptor.Encrypt() , userPassword and ownerPassword . Just pass null to the

TCPDF UTF-8. Lithuanian symbols not showing up

◇◆丶佛笑我妖孽 提交于 2019-11-27 07:26:55
Im using latest TCPDF version(5.9). But have some strange problems with encoding. I need Lithuanian language symbols like: ąčęėįšųūž. But get only few of it. Other remain like ????? So what should I do ? I use default times font(it comes with TCPDF download). Any help would be appreciated. Set the $unicode parameter on the TCPDF constructor to false and the $encoding parameter to 'ISO-8859-1' or some other character map. This will help you: Default for UTF-8 unicode: $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); Example of constructor for European

PdfPTable as a header in iTextSharp

假如想象 提交于 2019-11-27 07:04:05
问题 I need a table with about 12 cells to display as a header. The following code fails to do this. I am aware table2 does not have 12 cells. On the second page, only "testing" is displayed. What am I missing? Thanks in advance! Document document = new Document(); try { PdfWriter.GetInstance(document, new FileStream("TableTest.pdf", FileMode.Create)); document.Open(); PdfPTable table = new PdfPTable(1); table.WidthPercentage = 100; PdfPTable table2 = new PdfPTable(2); //logo PdfPCell cell2 = new

How do I intercept the output stream of the current actionresult in .NET MVC3?

烈酒焚心 提交于 2019-11-27 07:00:56
问题 Hi and thanks for looking! Background I am using the Rotativa pdf tool to read a view (html) into a PDF. It works great, but it does not natively offer a way to save the PDF to a file system. Rather, it only returns the file to the user's browser as a result of the action. Here is what that code looks like: public ActionResult PrintQuote(FormCollection fc) { int revisionId = Int32.Parse(Request.QueryString["RevisionId"]); var pdf = new ActionAsPdf( "Quote", new { revisionId = revisionId }) {