pub enum PdfPageContentRegenerationStrategy {
AutomaticOnEveryChange,
AutomaticOnDrop,
Manual,
}Expand description
Content regeneration strategies that instruct pdfium-render when, if ever, it should
automatically regenerate the content of a PdfPage.
Updates to a PdfPage are not committed to the underlying PdfDocument until the page’s content is regenerated. If a page is reloaded or closed without regenerating the page’s content, any changes not applied are lost.
By default, pdfium-render will trigger content regeneration on any change to a PdfPage;
this removes the possibility of data loss, and ensures changes can be read back from other
data structures as soon as they are made. However, if many changes are made to a page at once,
then regenerating the content after every change is inefficient; it is faster to stage
all changes first, then regenerate the page’s content just once. In this case,
changing the content regeneration strategy for a PdfPage can improve performance,
but you must be careful not to forget to commit your changes before the PdfPage moves out of scope.
Variants§
AutomaticOnEveryChange
pdfium-render will call the PdfPage::regenerate_content() function on any
change to this PdfPage. This is the default setting.
AutomaticOnDrop
pdfium-render will call the PdfPage::regenerate_content() function only when
this PdfPage is about to move out of scope.
Manual
pdfium-render will never call the PdfPage::regenerate_content() function.
You must do so manually after staging your changes, or your changes will be lost
when this PdfPage moves out of scope.
Trait Implementations§
source§impl Clone for PdfPageContentRegenerationStrategy
impl Clone for PdfPageContentRegenerationStrategy
source§fn clone(&self) -> PdfPageContentRegenerationStrategy
fn clone(&self) -> PdfPageContentRegenerationStrategy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl PartialEq<PdfPageContentRegenerationStrategy> for PdfPageContentRegenerationStrategy
impl PartialEq<PdfPageContentRegenerationStrategy> for PdfPageContentRegenerationStrategy
source§fn eq(&self, other: &PdfPageContentRegenerationStrategy) -> bool
fn eq(&self, other: &PdfPageContentRegenerationStrategy) -> bool
self and other values to be equal, and is used
by ==.