mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-08-29 15:22:06 +02:00
Add pdfioFileGet/SetLanguage functions (Issue #124)
This commit is contained in:
38
pdfio-file.c
38
pdfio-file.c
@@ -838,6 +838,24 @@ pdfioFileGetKeywords(pdfio_file_t *pdf) // I - PDF file
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 'pdfioFileGetLanguage()' - Get the language metadata for a PDF file.
|
||||
//
|
||||
// This function gets the (primary/default) language metadata, if any, for a PDF
|
||||
// file. The returned string is an IETF BCP 47 language tag of the form
|
||||
// "lang-REGION". For example, the string "en-CA" specifies Canadian English
|
||||
// and the string "fr-CA" specifies Canadian French.
|
||||
//
|
||||
// @since PDFio 1.6@
|
||||
//
|
||||
|
||||
const char * // O - Language or `NULL` for none
|
||||
pdfioFileGetLanguage(pdfio_file_t *pdf) // I - PDF file
|
||||
{
|
||||
return (pdfioDictGetString(pdfioFileGetCatalog(pdf), "Lang"));
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 'pdfioFileGetModificationDate()' - Get the most recent modification date for a PDF file.
|
||||
//
|
||||
@@ -1178,6 +1196,26 @@ pdfioFileSetKeywords(
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 'pdfioFileSetLanguage()' - Set the language metadata for a PDF file.
|
||||
//
|
||||
// This function sets the (primary/default) language metadata for a PDF file.
|
||||
// The "value" argument is an IETF BCP 47 language tag string of the form
|
||||
// "lang-REGION". For example, the string "en-CA" specifies Canadian English
|
||||
// and the string "fr-CA" specifies Canadian French.
|
||||
//
|
||||
// @since PDFio 1.6@
|
||||
//
|
||||
|
||||
void
|
||||
pdfioFileSetLanguage(
|
||||
pdfio_file_t *pdf, // I - PDF file
|
||||
const char *value) // I - Value
|
||||
{
|
||||
pdfioDictSetString(pdfioFileGetCatalog(pdf), "Lang", value);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 'pdfioFileSetModificationDate()' - Set the modification date for a PDF file.
|
||||
//
|
||||
|
Reference in New Issue
Block a user