56
* Reads a PDF document from the given file. A newly allocated PDF packet
57
* will be returned; it is the user's responsibility to deallocate this
58
* when it is finished with.
60
* This routine does not check whether the given file \e looks like a
61
* PDF document; it simply loads the file contents blindly.
63
* The packet label of the new PDF packet will be left empty.
65
* If the file could not be read, 0 will be returned.
67
* \i18n This routine makes no assumptions about the
68
* \ref i18n "character encoding" used in the given file \e name, and
69
* simply passes it through unchanged to low-level C/C++ file I/O routines.
71
* @param filename the filename of the PDF document to read.
72
* @return a new PDF packet containing the PDF document, or 0 on error.
59
* Deprecated function that reads a PDF document from the given file.
61
* If the file could not be read, or if the file is empty, then 0 will be
62
* returned. Otherwise a newly allocated PDF packet will be returned, and it
63
* is the user's responsibility to deallocate this when it is finished with.
65
* \deprecated You should use the NPDF constructor NPDF::NPDF(const char*),
66
* and you should pass the filename as the single string argument.
67
* In situations where this routine would have returned a null pointer, the
68
* NPDF constructor will instead create a null document (i.e., one for which
69
* NPDF::isNull() returns \c true). See the NPDF constructor for further
74
72
REGINA_API NPDF* readPDF(const char *filename);
77
* Writes the given PDF document to the given file.
79
* This routine does not check whether the contents of the given packet
80
* \e look like a PDF document; it simply writes them blindly to the
83
* If the given PDF packet is empty (i.e., does not contain a real block
84
* of data) then the resulting file will be created but left empty.
86
* \i18n This routine makes no assumptions about the
87
* \ref i18n "character encoding" used in the given file \e name, and
88
* simply passes it through unchanged to low-level C/C++ file I/O routines.
90
* @param filename the filename of the PDF document to write.
91
* @param pdf the PDF packet to write to the given file.
92
* @return \c true if the export was successful, or \c false otherwise.
75
* Deprecated function that writes the given PDF document to the given file.
77
* \deprecated This routine has been renamed as NPDF::savePDF(). This old
78
* routine behaves exactly as in the past, but the new NPDF::savePDF() has
79
* a slight change in behaviour: if the PDF packet contains no data then
80
* it no longer creates an empty file, but instead does nothing and returns
81
* \c false. See NPDF::savePDF() for further details.
94
83
REGINA_API bool writePDF(const char* filename, const NPDF& pdf);