
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Save code files into PDF format with syntax highlighting.
It can convert a single code file or all files in a project (folder) using one command.
Updated for MacOS M2 Chipset.
> pip install PDFCode
########################################
# install wkhtmltopdf
> brew cask reinstall wkhtmltopdf
# or
# brew install caskroom/cask/wkhtmltopdf
########################################
########################################
# install libmagic
> brew install libmagic
########################################
from PDFCode import PDFCode
> pdfcode --help
# usage: PDFCode.py [-h] [--dst [DST]] [-l] [-s SIZE] [-S NAME] [-m MARGIN]
# [--ignore IGNORE] [-v]
# src
# Convert source files into .pdf with syntax highlighting
# positional arguments:
# src The path of the file/folder
# optional arguments:
# -h, --help show this help message and exit
# --dst [DST] The path of the saving target folder. Empty will save
# to PDFCode_Results/
# -l, --linenos Include line numbers.
# -s SIZE, --size SIZE PDF size. Letter,A1,A2,A3,A4,A5, etc.
# -S NAME, --style NAME
# The style name for highlighting.
# -m MARGIN, --margin MARGIN
# The layout margins in inch (default 0.4in).
# --ignore IGNORE Ignore files whose names contain sub-string. (multiple
# ignore str splited using , e.g., --ignore abc,.jpg to
# ignore 'abc' and '.jpg')
# -v, --version show program's version number and exit
Example
# process single file:
> pdfcode ./test/algol.py -s a4 -S colorful --ignore .json,test
# process all files in a folder and its subfolders:
> pdfcode ./test -s a4 -S colorful
Now, the code supports 36 styles:
abap | algol | algol_nu | arduino | autumn | borland |
---|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
bw | colorful | default | emacs | friendly | fruity |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
igor | inkpot | lovelace | manni | monokai | murphy |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
native | paraiso-dark | paraiso-light | pastie | perldoc | rainbow_dash |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
rrt | sas | solarized-dark | solarized-light | stata | stata-dark |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
stata-light | tango | trac | vim | vs | xcode |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
FAQs
Save code files into PDF format with syntax highlighting.
We found that PDFCode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.