def from_notebook_node(self, nb, resources=None, **kw):
        """Takes PDF output from PDFExporter and uploads to One Codex Documents portal."""
        output, resources = super(OneCodexDocumentExporter, self).from_notebook_node(
            nb, resources=resources, **kw
        )

        from onecodex import Api
        from onecodex.lib.upload import upload_document_fileobj

        ocx = Api()

        default_filename = "Analysis Report - {dt:%B} {dt.day}, {dt:%Y}".format(
            dt=datetime.datetime.now()
        )

        file_name = resources["metadata"].get("one_codex_doc_portal_filename", default_filename)

        try:
            document_id = upload_document_fileobj(
                BytesIO(output), file_name, ocx._client.session, ocx.Documents._resource
            )
        except UploadException as exc:
            resp = json.dumps({"status": 500, "message": str(exc)})
            return resp, resources
        except Exception:
            resp = json.dumps(
                {
                    "status": 500,
                    "message": "Upload failed. Please contact help@onecodex.com for assistance.",
                }
            )
            return resp, resources

        resp = json.dumps({"status": 200, "document_id": document_id})
        return resp, resources
Takes PDF output from PDFExporter and uploads to One Codex Documents portal.