Commit graph

54 commits

Author SHA1 Message Date
dependabot[bot]
bdb77ba521
chore(deps): bump bleach from 2.1.4 to 3.1.2 (#9779)
* chore(deps): bump bleach from 2.1.4 to 3.1.2

Bumps [bleach](https://github.com/mozilla/bleach) from 2.1.4 to 3.1.2.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v2.1.4...v3.1.2)

Signed-off-by: dependabot[bot] <support@github.com>

* chore: use html.parser instead of html5lib

bleach no longer ships html5lib as a requirement and instead has
included it in the system. we can switch to using html.parser instead;
which is not an external dependency unlike html5lib.

source: https://github.com/mozilla/bleach/blob/master/CHANGES#L206

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: use html5lib from bleach

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: import html5lib from bleach._vendor

fixes issue where bs4 is unable to find html5lib in the tree:

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: bleach._vendor.html5lib. Do you need to install a parser library?

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

* chore: just give up and install html5lib as a dependency

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-03-25 00:20:57 +05:30
Alirio Castro
23d3f0e63b
feat: Indicate orientation for PDF file (#9660)
Same as other attributes, we could indicate default orientation by indicating in the .print-format css class without hardcoding, which is useful for cloud users.

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-03-16 17:31:28 +05:30
Rohan Bansal
67791ff194 fix(pdf): error when trying to print PDFs 2019-12-26 14:44:19 +05:30
Rohit Waghchaure
7494328106 fix: disable smart shrinking for version 0.12.5 2019-10-25 18:36:26 +05:30
Rohit Waghchaure
7fc55d2cbd fix: font size showing small after upgrade to 0.12.5 2019-10-14 17:43:41 +05:30
ci2014
f0b59df21c Let developers choose the margins (#8513)
* Let developers choose the margins

Let the developers choose the margins

* fix: remove trailing whitespace
2019-10-03 06:25:38 +00:00
Shivam Mishra
8bc753b881 chore: disable pdf encryption for multipdf 2019-06-06 16:26:44 +05:30
Suraj Shetty
d67bcd2212 fix: Define filedata before it is used 2019-05-05 12:23:46 +05:30
Shivam Mishra
87bb91b64f fix: key error on password 2019-04-30 09:41:25 +05:30
Shivam Mishra
8e29bc4bf7 fix: possible fix to encoding issues in py3 2019-04-27 18:03:00 +05:30
Shivam Mishra
01a2df7e5a feat: code imporvements 2019-04-27 16:26:13 +05:30
Shivam Mishra
02c6abe609 feat: minor changes to pdf.py 2019-04-27 16:22:56 +05:30
Shivam Mishra
a9ca81370b fix: encoded password 2019-04-25 18:22:14 +05:30
Shivam Mishra
d791285ac2 feat: Added encryption feature for pdfs 2019-04-25 17:23:38 +05:30
Sagar Vora
fe3fe0a4b8 Merge branch 'master' into staging-fixes 2019-01-29 17:08:58 +05:30
Aditya Hase
36bc812c94 fix(security): Make server-side PDF rendering tighter 2019-01-28 12:41:21 +05:30
Aditya Hase
6b72faf44f style: Linting fixes (#6809)
* style: Remove unused imports

* style: Remove unused local variables
2019-01-23 16:39:55 +05:30
Saif
25827755b5 PDF allow parsing header-spacing (#6286)
Simply allow parsing header-spacing from custom css.
2018-10-22 10:13:26 +05:30
Nabin Hait
854b068ee9 Fixed merge conflict 2018-07-31 13:15:15 +05:30
Shreya Shah
4c20d1f68f using regex instead of soup to parse pdf page margins (#5883)
* using regex instead of soup to parse pdf page margins

* Fix codacy
2018-07-30 14:32:33 +05:30
Sagar Vora
5ddcf40a11 [python3] let PdfFileReader handle file opening (#5878)
In Python 3, file() is deprecated. 
PdfFileReader can internally handle file opening and closing, so file() no longer necessary.

See description of stream parameter here:
https://pythonhosted.org/PyPDF2/PdfFileReader.html#PyPDF2.PdfFileReader

Alternatively, open() can be used.
2018-07-27 11:55:48 +05:30
Prateeksha Singh
d2dfda2711
Merge pull request #4973 from lasalesi/configurablepdfborder
using regex instead of soup to parse pdf page margins
2018-05-03 17:41:52 +05:30
Achilles Rasquinha
796348cd60 fix indentation 2018-03-29 15:39:49 +05:30
Austin Bischoff
bf7ad3f3f1 pdf.py does not handle output properly if ContentNotFoundError is thrown (#5296)
If wkhtmltopdf throws a ContentNotFoundError exception (even though there is content) or other catchable exceptions the output keyword is not updated properly as it is in the try: section if no exception is thrown.   This causes the PDF being returned to be empty, empty PdfFileWriter() created in print_format.py line 26. This causes issues like https://github.com/frappe/erpnext/issues/13124 to occur where the viewer.js throws an error due to a bad pdf file.  The ContentNotFoundError exception is happening due to no header image in the letterhead or its a bad link being used when multi printing. 

The whole get_pdf() function should be rebuilt to test for ContentNotFoundError and other errors from wkhtmltopdf and then use a secondary try/catch to check for any other IOErrors related to being able to read the PDF back in from the file.  Right now this is not DRY since I basically copy and pasted lines 18 - 22 under line 31 so that if there is an error but the file exists the output will still be appended properly.
2018-03-29 12:00:05 +05:30
lasalesi
a60002726a corrected trailing whitespace (codacy) 2018-03-08 11:18:21 +01:00
Faris Ansari
cd54b6f6a1 Query Report (#5097)
* [listview] Show freeze message

* Call refresh on same page

* Simplify query_report lifecycle, Print partially working

* PDF Print, frappe.render_pdf

* Show freeze message

* Export
2018-02-28 17:10:09 +05:30
lasalesi
70756cf3c6 using regex instead of soup to parse pdf page margins 2018-02-06 13:46:23 +01:00
Juan F Fernández
3c8689e4a2 [FIX] Fixed problem with margins in pdf (see #3451 #4235 #4239) (#4297) 2017-10-18 09:21:36 +03:00
rohitwaghchaure
192fae169c [Fix] Letter head not displaying proper in the pdf (#4251) 2017-10-05 13:01:35 +05:30
maxtorete
c4ab2de7fd Fixed problem with margin top and bottom overwritten in print format (#3451) 2017-09-23 03:46:13 +02:00
Aditya Hase
000d9a41b6 Use PyPDF2 instead of pyPdf 2017-08-11 00:39:24 +05:30
tundebabzy
6fbe20caaa Except and raise statement python 3 compatible style (#3216)
* changes exception and raise statements to python 3 style

* changes except statement to python 3 style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* adds six.reraise to fix python 3 style raise statements with traceback

* fixes indentation
2017-05-11 10:51:59 +05:30
rohitwaghchaure
e03d56adb6 [Fix] Multiple letter head printing issue on print format (#2365) 2016-11-25 16:10:42 +05:30
Rushabh Mehta
ea9c92daa5 [hot] ignoring loading errors causes background images to not load 2016-09-30 16:20:20 +05:30
Rushabh Mehta
74c4cbdba8 [minor] ignore load issues in wkhtmltopdf 2016-09-20 17:12:25 +05:30
Rushabh Mehta
2491c3e335 [minor] fix for pdf print 2016-08-29 11:31:47 +05:30
Rushabh Mehta
e03d22bb37 [fix] change parser in pdf generation 2016-03-03 17:16:22 +05:30
kardmode
3679689d71 [fix] for html parser for multi doc printing
BeautifulSoup parser "html5lib" doesn't work well with multi doc
printing
2016-02-28 16:15:18 +04:00
Anand Doshi
f14683e91e [fix] pdf print: footer encoding and workaround to include bootstrap in footer 2016-01-28 16:41:11 +05:30
Anand Doshi
8b0b93a3a8 [enhancement] PDF: Footer option in Letter Head and show page number at the bottom 2016-01-28 15:56:45 +05:30
Anand Doshi
78bd12d8b0 [fix] typo in pdf header/footer code 2016-01-28 15:56:45 +05:30
Anand Doshi
2e7e73baac [fix] improvements in header/footer code 2016-01-27 20:51:23 +05:30
gabtzi
200ad06b5c Enchancement - provide header/footer HTML code and adjust margins on the fly in custom print formats 2016-01-27 20:51:23 +05:30
Anand Doshi
6bfd4138cf [fix] handle content error in pdf.py 2016-01-20 14:52:40 +05:30
Anand Doshi
5165df0af9 [fix] pass session to tasks.sendmail to give access to private files 2015-12-21 13:15:08 +05:30
Anand Doshi
8a5addaae7 [feature] Private files. Fixes #927
- Option during upload + all new incoming email files will be private
- Paired with @rmehta
2015-12-09 14:02:14 +05:30
Anand Doshi
16c8926c36 [fix] ignore broken images in pdf 2015-11-11 17:58:17 +05:30
Rushabh Mehta
69fac8f5e9 [pdf] santize error message for bad image links 2015-07-02 14:23:37 +05:30
Anand Doshi
2995f02f3b Web Notes to Frappe, better alerts, css fixes, fixed splash 2015-03-03 15:09:34 +05:30
Anand Doshi
f6cdd4a655 Merge remote-tracking branch 'frappe/develop' into v5.0
Conflicts:
	frappe/__version__.py
	frappe/core/doctype/communication/communication.py
	frappe/core/page/desktop/desktop.js
	frappe/hooks.py
	frappe/translations/ar.csv
	frappe/translations/es.csv
	frappe/translations/fr.csv
	frappe/translations/hr.csv
	frappe/translations/id.csv
	frappe/translations/ja.csv
	frappe/translations/nl.csv
	frappe/translations/pl.csv
	frappe/translations/pt-BR.csv
	frappe/translations/ru.csv
	frappe/translations/tr.csv
	frappe/translations/zh-cn.csv
	frappe/translations/zh-tw.csv
	frappe/utils/email_lib/html2text.py
	setup.py
2015-02-24 18:06:16 +05:30