pdf

how to reduce the size of png image in pdf (compress png in pdf)

三世轮回 提交于 2020-06-17 13:19:20
问题 I want to reduce the size of pdf file by replacing the high-resolution image with a lower-resolution image. To complete the issue, I have to: extract the images(streams) from pdf compress the images replace the images(streams) in the pdf with compressed images When I extract png images and replace them, the transparent background changes to a black background. I extract the images from the pdf to figure out the reason. There is something very strange that pdf uses to stream to save a png. So

how to reduce the size of png image in pdf (compress png in pdf)

只愿长相守 提交于 2020-06-17 13:19:07
问题 I want to reduce the size of pdf file by replacing the high-resolution image with a lower-resolution image. To complete the issue, I have to: extract the images(streams) from pdf compress the images replace the images(streams) in the pdf with compressed images When I extract png images and replace them, the transparent background changes to a black background. I extract the images from the pdf to figure out the reason. There is something very strange that pdf uses to stream to save a png. So

camelot python;OSError: exception: access violation writing 0x00000080

房东的猫 提交于 2020-06-16 17:17:30
问题 I was trying to extract tables from a PDF file with Camelot. Here is my code: import camelot tables = camelot.read_pdf('foo.pdf') print(tables) and I am getting the error while running this script as follows: File "C:/Users/gibin/PycharmProjects/ML/Table_Tester.py", line 20, in <module> table=tables = camelot.read_pdf(r"C:\Users\gibin\PycharmProjects\ML\Doc_downloader\GWC_Docs\781313686.pdf") File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\io.py", line

camelot python;OSError: exception: access violation writing 0x00000080

纵饮孤独 提交于 2020-06-16 17:16:52
问题 I was trying to extract tables from a PDF file with Camelot. Here is my code: import camelot tables = camelot.read_pdf('foo.pdf') print(tables) and I am getting the error while running this script as follows: File "C:/Users/gibin/PycharmProjects/ML/Table_Tester.py", line 20, in <module> table=tables = camelot.read_pdf(r"C:\Users\gibin\PycharmProjects\ML\Doc_downloader\GWC_Docs\781313686.pdf") File "C:\Users\gibin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\camelot\io.py", line

How do I reverse the order of the pages in a pdf file using pyPdf?

纵然是瞬间 提交于 2020-06-16 06:41:06
问题 I have a pdf file "myFile.pdf". I would like to reverse the order of its pages using pyPdf. How? 回答1: from pyPdf import PdfFileWriter, PdfFileReader output_pdf = PdfFileWriter() with open(r'input.pdf', 'rb') as readfile: input_pdf = PdfFileReader(readfile) total_pages = input_pdf.getNumPages() for page in xrange(total_pages - 1, -1, -1): output_pdf.addPage(input_pdf.getPage(page)) with open(r'output.pdf', "wb") as writefile: output_pdf.write(writefile) 回答2: Thanks for sharing suggestions. I

How can I link a page in a local PDF file?

99封情书 提交于 2020-06-14 04:53:45
问题 I load a PDF file when user clicks a button using jQuery, but it opens the document starting from the first page (as it is always). I would like to link a specific page depending of the needed chapter. Is it there any way to do this nice to have thing? Here is how I open the document: $('#btnManual').click(function() { window.open('documentation/test.pdf'); }); 回答1: To target an HTML link to a specific page in a PDF file, add #page=[page number] to the end of the link's URL. For example, this

How can I link a page in a local PDF file?

自作多情 提交于 2020-06-14 04:53:05
问题 I load a PDF file when user clicks a button using jQuery, but it opens the document starting from the first page (as it is always). I would like to link a specific page depending of the needed chapter. Is it there any way to do this nice to have thing? Here is how I open the document: $('#btnManual').click(function() { window.open('documentation/test.pdf'); }); 回答1: To target an HTML link to a specific page in a PDF file, add #page=[page number] to the end of the link's URL. For example, this

PDF content stream “TJ /Tj” split without messing the remaining text matrices?

↘锁芯ラ 提交于 2020-06-13 09:36:33
问题 I want to split TJ/Tj operator's COSString using the PDFBOX. My pdf current content stream looks like below. Desired output or what I tried? public static void SplitTj_TJ(int tj_ind, PDDocument document) throws IOException{ PDPage page = document.getPage(0); PDFStreamParser parser = new PDFStreamParser(page); parser.parse(); List tokens = parser.getTokens(); Operator op = (Operator) tokens.get(tj_ind); COSFloat dest_x = new COSFloat((float) 90.81199646); COSFloat dest_y = new COSFloat((float)

Load PDF into UIImage or UIImageView?

一曲冷凌霜 提交于 2020-06-12 03:33:36
问题 This is my first ever question on stackoverflow. I'm trying to load a PDF file stored in Resources into a UIImage/UIImageView object in the iPhone SDK. Is this at all possible without converting the PDF to an image? If not, what are the member functions for converting a PDF into a PNG? I would really prefer to preserve the PDF if at all pssoible. Thanks so much for the help! 回答1: PDFs can be loaded by UIWebView. If you need more control you can use Quartz 2D to render PDFs: Quartz2D 回答2: Now

In PDFBox, how to create a link annotation with “rollover” / “mouse over” effects?

一曲冷凌霜 提交于 2020-06-11 07:55:51
问题 Question: With PDFBox, how can I create a link annotation with "mouse over" color effect (aka rollover / mouse hover)? It means that when I hover my mouse cursor over a link in a PDF file (without clicking it), the link changes to a different color. And if I mouse the cursor away, the link changes backs to the original color. For example: The effect that I am looking for is similar to the links at stackoverflow website. When you hover the mouse cursor over ( without clicking ) the "Ask