pdf

How to create / set custom color of table cells and borders in iText 7?

余生长醉 提交于 2020-07-06 20:23:32
问题 I need to create a table which has custom colored cells and borders. There are a few constants defined in the Color class, but what I need a custom color. I need #a6cb0b as the background color for the header and border lines with color code #cccccc. How do I set them? Table table = new Table(new float[]{1,1,1}); Cell cell = new Cell(); cell.add(new Paragraph("TITLE")); cell.setBackgroundColor(Color.???); table.addCell(cell); ... ... 回答1: The best way to find out how to create colors, is to

iText7 Create PDF in memory instead of physical file

六月ゝ 毕业季﹏ 提交于 2020-07-06 13:52:07
问题 How do one create PDF in memorystream instead of physical file using itext7? I have no idea how to do it in the latest version, any help? I tried the following code, but pdfSM is not properly populated: string filePath = "./abc.pdf"; MemoryStream pdfSM = new ByteArrayOutputStream(); PdfDocument doc = new PdfDocument(new PdfReader(filePath), new PdfWriter(pdfSM)); ....... doc.close(); The full testing code as below for your reference, it worked when past filePath into PdfWriter but not for the

Parsing a PDF via URL with Python using pdfminer

会有一股神秘感。 提交于 2020-07-05 12:35:25
问题 I am trying to parse this file but without downloading it off of the website. I have run this with the file on my hard drive and I am able to parse it without issue but running this script it trips. if not document.is_extractable: raise PDFTextExtractionNotAllowed I think I am integrating the url wrong. import sys import getopt import urllib2 import datetime import re from pdfminer.pdfparser import PDFParser from pdfminer.converter import XMLConverter, HTMLConverter, TextConverter,

How to convert Assets Images & Icons to PdfImage in flutter using dart_pdf

若如初见. 提交于 2020-07-05 10:36:08
问题 Used Library: dart_pdf After searching I found the same issue in GITHUB but unable to resolve the issue. I tried this but blurry image appears. Please help!! ByteData data = await rootBundle.load('assets/test.jpg'); var codec = await instantiateImageCodec(data.buffer.asUint8List()); var frame = await codec.getNextFrame(); var imageBytes = await frame.image.toByteData(); PdfImage assetImage = PdfImage(pdf.document, image: imageBytes.buffer.asUint8List(), width: 86, height: 80); Rendered Image:

How to convert Assets Images & Icons to PdfImage in flutter using dart_pdf

[亡魂溺海] 提交于 2020-07-05 10:35:06
问题 Used Library: dart_pdf After searching I found the same issue in GITHUB but unable to resolve the issue. I tried this but blurry image appears. Please help!! ByteData data = await rootBundle.load('assets/test.jpg'); var codec = await instantiateImageCodec(data.buffer.asUint8List()); var frame = await codec.getNextFrame(); var imageBytes = await frame.image.toByteData(); PdfImage assetImage = PdfImage(pdf.document, image: imageBytes.buffer.asUint8List(), width: 86, height: 80); Rendered Image:

PDF that renders in Chrome but not in Acrobat

ぃ、小莉子 提交于 2020-07-05 07:32:08
问题 %PDF-1.7 4 0 obj <</Type/ObjStm/N 3/First 14/Length 139>> stream 1 0 2 41 3 76 <</Type/Catalog/Version/1.7/Pages 2 0 R>><</Type/Pages/Kids[3 0 R]/Count 1>><</Type/Page/MediaBox[0 0 200 200]/Parent 2 0 R>> endstream endobj 5 0 obj << /Root 1 0 R /ID[<7F1FE2C507E6DB4CB0787E660F2B0C65><2450E4E8FF5FC84380428886C0DD4C2F>] /Size 6 /Index[1 5] /W[1 4 1] /Type/XRef /Length 68 /Filter[/ASCIIHexDecode] >> stream 020000000400 020000000401 020000000402 010000000A00 01000000E500 endstream endobj startxref

Create outlines/TOC for existing PDF in Python

自古美人都是妖i 提交于 2020-07-05 03:29:28
问题 I'm using pyPdf to merge several PDF files into one. This works great, but I would also need to add a table of contents/outlines/bookmarks to the PDF file that is generated. pyPdf seems to have only read support for outlines. Reportlab would allow me to create them, but the opensource version does not support loading PDF files, so that doesn't work to add outlines to an existing file. Is there any way I can add outlines to an existing PDF using Python, or any library that would allow that?

How to open a pdf within Python Kivy app?

南楼画角 提交于 2020-07-03 11:42:34
问题 I've searched about this but found nothing. Only opening images has documented. Maybe I can open a page as an image but I want full access on text like copy/paste and highlighting. Is there any way to open a pdf within a kivy app? 回答1: This is not supported by Kivy. PDF rendering and interaction is quite complicated, I don't know how difficult it would be to implement. 来源: https://stackoverflow.com/questions/61145384/how-to-open-a-pdf-within-python-kivy-app

How to open a pdf within Python Kivy app?

送分小仙女□ 提交于 2020-07-03 11:42:30
问题 I've searched about this but found nothing. Only opening images has documented. Maybe I can open a page as an image but I want full access on text like copy/paste and highlighting. Is there any way to open a pdf within a kivy app? 回答1: This is not supported by Kivy. PDF rendering and interaction is quite complicated, I don't know how difficult it would be to implement. 来源: https://stackoverflow.com/questions/61145384/how-to-open-a-pdf-within-python-kivy-app

Laravel:Trying to generate pdf with charts but on generated pdf charts are not showing

送分小仙女□ 提交于 2020-06-29 07:12:14
问题 I have installed laravel 5.6 and and installed barryvdh/laravel-dompdf package. I have used some jquery chart plugin to show chart on blade file, it's works fine. By using dompdf package , I am trying to shown this piechart on pdf, but chart's are not showing on pdf. How to show charts on pdf, Is there any solution to show charts on streaming/download pdf.? The chart plugin/library shows the following chart when viewing on blade file: What I am trying is to show this chart on streaming