skm_tools.pdf_utils =================== .. py:module:: skm_tools.pdf_utils .. autoapi-nested-parse:: Crop PDF files and combine them into one, with captions (e.g. exported network views). Requires the ``pdf`` extra (``pip install skm-tools[pdf]``). To export the networks of a Cytoscape collection as cropped PDFs, see :func:`skm_tools.cytoscape_utils.export_collection` (``format="PDF", crop=True``). Attributes ---------- .. autoapisummary:: skm_tools.pdf_utils.logger Functions --------- .. autoapisummary:: skm_tools.pdf_utils.crop_pdf skm_tools.pdf_utils.combine_pdfs Module Contents --------------- .. py:data:: logger .. py:function:: crop_pdf(path, out=None, margins=None) Crop the margins of a PDF (with pdfCropMargins). :param path: PDF to crop. :type path: str or pathlib.Path :param out: File to write (default: replace `path`). :type out: str or pathlib.Path, optional :param margins: Space to add after cropping (left, bottom, right, top), in points, e.g. ``(0, 20, 0, 0)`` for a caption below. Default: none. :type margins: tuple of float, optional :returns: The cropped file. :rtype: pathlib.Path .. py:function:: combine_pdfs(files, filename, captions=None, font_size=20, font='Helvetica') Combine PDFs into one, a page each (the first page of each file), with captions. :param files: PDFs to combine, in order (e.g. from :func:`skm_tools.cytoscape_utils.export_collection`). They are not changed. :type files: iterable of str or pathlib.Path :param filename: PDF file to write (overwritten if it exists). :type filename: str or pathlib.Path :param captions: A caption for each page, written below it (default: none). :type captions: list of str, optional :param font_size: Caption font size (default 20). :type font_size: float :param font: Caption font (default Helvetica; the default font if unavailable). :type font: str :returns: `filename`. :rtype: pathlib.Path