Changeset 49 for trunk/src/PDFDocument.cxx
- Timestamp:
- 04/13/06 05:47:01 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/PDFDocument.cxx (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PDFDocument.cxx
r43 r49 38 38 39 39 /// 40 /// @brief Constructs a new Document object.40 /// @brief Constructs a new PDFDocument object. 41 41 /// 42 42 PDFDocument::PDFDocument (): … … 48 48 49 49 /// 50 /// @brief Deletes all dynamically created objects of Document.50 /// @brief Deletes all dynamically created objects of PDFDocument. 51 51 /// 52 52 PDFDocument::~PDFDocument () … … 59 59 /// @brief Checks if the document has been loaded. 60 60 /// 61 /// @return true if the document has been loaded, falseotherwise.61 /// @return TRUE if the document has been loaded, FALSE otherwise. 62 62 /// 63 63 gboolean … … 68 68 69 69 /// 70 /// @brief Load a PDF file.70 /// @brief Loads a PDF file. 71 71 /// 72 72 /// Tries to open the PDF file @a filename using the password in @a password. 73 73 /// 74 /// @param filename The name of the file name to open.74 /// @param filename The name of the file name to open. 75 75 /// @param password The password to use to open @a filename. 76 /// @param error Locat rion to store the error ocurringmor NULL to ignore76 /// @param error Location to store the error occurring or NULL to ignore 77 77 /// errors. 78 78 /// 79 /// @return T rue if the file could be opened, falseotherwise.79 /// @return TRUE if the file could be opened, FALSE otherwise. 80 80 /// 81 81 gboolean … … 83 83 GError **error) 84 84 { 85 g_assert (NULL != filename && "Tried to load a NULL file name");86 87 // The poppler library has a GLOBAL file for parameters.85 g_assert (NULL != filename && "Tried to load a NULL file name"); 86 87 // The Poppler library has a GLOBAL file for parameters. 88 88 // If this file isn't loaded then weird error happens. 89 89 if ( NULL == globalParams ) … … 104 104 // deleting it will cause trouble when deleting the newDocument. 105 105 106 // Check if the document couldn't be opened suc essfully and why.106 // Check if the document couldn't be opened successfully and why. 107 107 if ( !newDocument->isOk() ) 108 108 { … … 116 116 g_free (errorMessage); 117 117 118 return false;118 return FALSE; 119 119 } 120 120 … … 128 128 m_OutputDevice->startDoc (m_Document->getXRef ()); 129 129 130 return true;131 } 132 133 /// 134 /// @brief Read the document's metadata.135 /// 136 /// After each successful load of a PDF file, its meta data is read and130 return TRUE; 131 } 132 133 /// 134 /// @brief Reads the document's meta data. 135 /// 136 /// After each successful load of a PDF file, its meta data is read and 137 137 /// keep in member variables of this class, so a call to get*() function 138 138 /// will return it. 139 139 /// 140 /// Also resets the rotation degree to 0 and the scale level to 1.0f. 141 /// 140 142 void 141 143 PDFDocument::loadMetadata (void) … … 143 145 g_assert (NULL != m_Document && "The document has not been loaded."); 144 146 145 // Retrieve the document's meta data dictionary.147 // Retrieve the document's meta data dictionary. 146 148 Object dictionary; 147 149 m_Document->getDocInfo (&dictionary); … … 168 170 setKeywords (value); 169 171 g_free (value); 170 // Is lineari zed172 // Is linearised 171 173 setLinearized (m_Document->isLinearized ()); 172 174 // Modified date … … 206 208 /// 207 209 /// Retrieves the string value of @a key inside the dictionary @a directory. The 208 /// dictiona ty must be an Object retrieved by calling Poppler's getDocInfo()210 /// dictionary must be an Object retrieved by calling Poppler's getDocInfo() 209 211 /// function. 210 212 /// … … 234 236 if ( hasUnicodeMarker (value_g) ) 235 237 { 236 // Convert the string skipping the unicode marker,238 // Convert the string skipping the Unicode marker, 237 239 // which is 2 bytes long (UTF-16BE). 238 240 result = g_convert (value_g->getCString () + 2, … … 271 273 /// 272 274 /// Retrieves the string value of @a key inside the dictionary @a directory. The 273 /// dictiona ty must be an Object retrieved by calling Poppler's getDocInfo()275 /// dictionary must be an Object retrieved by calling Poppler's getDocInfo() 274 276 /// function. 275 277 /// … … 301 303 { 302 304 // Copy the string skipping the two-bytes long 303 // unicode marker.305 // Unicode marker. 304 306 dateString = g_convert (value_g->getCString () + 2, 305 307 value_g->getLength () - 2, … … 350 352 351 353 /// 352 /// @brief Checks if a GooString has the unicode marker.354 /// @brief Checks if a GooString has the Unicode marker. 353 355 /// 354 356 /// I really don't know, but it seems that some PDF files has UTF-16BE … … 356 358 /// Order Marker), which is 0xfeff for Big Endian and 0xfffe for Little Endian. 357 359 /// 358 /// @param string The string to check if has the unicode marker.359 /// 360 /// @return true if the GooString has the unicode marker, falseotherwise.360 /// @param string The string to check if has the Unicode marker. 361 /// 362 /// @return TRUE if the GooString has the Unicode marker, FALSE otherwise. 361 363 /// 362 364 gboolean … … 368 370 369 371 /// 370 /// @brief Get the document's page layout.372 /// @brief Gets the document's page layout from Poppler's catalog. 371 373 /// 372 374 /// @param pageLayout Is the page layout that Poppler's catalog gives.
