[PYTHON] [HOW TO] Easy way to debug when generating PDF files with PHP etc.

sample(rotatetext)-2.jpg

Hello. I think there is still a lot of work to generate PDF files on the server side. Even if the Web has penetrated so much, I think that it is the most suitable method when you want to print PDF related to forms or publish Adobe Illustrator files easily. Of course, I think there is a lot of development work that dynamically generates PDF files on the server side. However, debugging is difficult when generating a PDF file on the server side. There are three main debugging methods below.


** (1) Generate PDF by print debugging Debugging while sneaking around with the numerical values and characters. ** **

Print debugging such as print and PHP's var_dump is the easiest, but you can't know how the PDF file is actually generated until you generate the PDF at the end.

** (2) Generate a log file on the server and debug while checking **

You can definitely check how the PDF is generated from the PDF logic, but it takes a lot of time to debug because it is necessary to check the log output to the server to check the calculated values etc. .. It's not a very realistic method.

** (3) Use a full-fledged debugger **

If you install debugging software (xdebug, etc.) on the server that generates PDF, you can perform full-scale debugging. You can probably debug efficiently. However, it is necessary to install the software separately on the server, and I think that there are many cases where it cannot be installed in the first place.


** ■ Let's develop easily and efficiently for the time being **

So let's use edump, which is as easy to use as print debugging and easy to grasp the status of data. logo.png  http://www.edump.net/

With edump, it doesn't matter what you're displaying on your browser screen, and you don't need to install any special software on the server, so you can easily debug. With the browser's developer extensions, you'll have a full-fledged development environment in no time. You can efficiently check the debug value while checking the status of the PDF generated on the server side. 20170505.jpg

Unlike desktop applications, WEB applications have some aspects that can be easily developed and some that are troublesome, but I think it is better to select an efficient method according to the situation.

Recommended Posts

[HOW TO] Easy way to debug when generating PDF files with PHP etc.
Easy way to rename files
How to handle static files when deploying to production with Django
[Linux] How to deal with garbled characters when viewing files
Convert files written in python etc. to pdf with syntax highlighting
Convert PDF files to PNG files with GIMP
How to debug with Jupyter or iPython Notebook
How to deal with errors when hitting pip ②
How to deal with SessionNotCreatedException when using Selenium
[Small story] Easy way to convert Jupyter to PDF
How to load files in Google Drive with Google Colaboratory
Easy way to scrape with python using Google Colab
How to access with cache when reading_json in pandas
An easy way to create an import module with jupyter
How to add page numbers to PDF files (in Python)
How to debug selenium
How to put a hyperlink to "file: // hogehoge" with sphinx-> pdf
How to output a document in pdf format with Sphinx
How to not load images when using PhantomJS with Selenium
Probably the easiest way to create a pdf with Python3
How to resolve CSRF Protection when using AngularJS with Django
How to upload files to Cloud Storage with Firebase's python SDK
How to update FC2 blog etc. using XMLRPC with python
How to deal with UnicodeDecodeError when executing google image download
How to output additional information when logging with python's logging module
Easy to make with syntax
How to update with SQLAlchemy?
How to cast with Theano
Integrate PDF files with Python
How to Alter with SQLAlchemy?
How to separate strings with','
How to RDP with Fedora31
How to Delete with SQLAlchemy?
How to not escape Japanese when dealing with json in python
Easy way to round off to the nearest whole number with python3
How to import CSV and TSV files into SQLite with Python
How to deal with errors when installing whitenoise and deploying to Heroku
How to deal with errors when installing Python and pip with choco
[Tips] How to do template extends when creating HTML with django