flowchart LR
String["D:YYYYMMDDHHmmSSOHH'mm'"] --> Parser[pdf_date_of_string]
Bytes[PDF bytes] --> Parser
Parser --> PdfDate
PdfDate --> Writer[pdf_string_of_date]
Writer --> Out[PDF date string]///|
test "date strings round trip" {
let input = "D:20240515112233+08'00'"
let date = try! @date.pdf_date_of_string(input)
inspect(try! @date.pdf_string_of_date(date), content=input)
}///|
test "bad date syntax raises shared PdfError" {
let result : Result[@date.PdfDate, Error] = try
@date.pdf_date_of_string("not a date")
catch {
err => Err(err)
} noraise {
value => Ok(value)
}
guard result is Err(@core.PdfError::BadDate) else {
fail("expected BadDate for malformed PDF date text")
}
}#deprecated("implicit trait-method promotion is being removed; call via the trait")
fn PdfStrftimeTime::equal(PdfStrftimeTime, PdfStrftimeTime) -> Bool#deprecated("implicit trait-method promotion is being removed; call via the trait")
fn PdfStrftimeTime::not_equal(x : PdfStrftimeTime, y : PdfStrftimeTime) -> Bool#deprecated("implicit trait-method promotion is being removed; call via the trait")
fn PdfStrftimeTime::to_json(PdfStrftimeTime) -> Json#deprecated("implicit trait-method promotion is being removed; call via the trait")
fn PdfStrftimeTime::to_repr(PdfStrftimeTime) -> ReprInstall
Download zipByte-oriented PDF reading, writing, and manipulation toolkit for MoonBit.
Dependencies