mirror of
https://github.com/typst/typst
synced 2025-07-27 22:37:54 +08:00
Remove the PDF embedding feature
This commit is contained in:
parent
cb436f9650
commit
2cd6c13be3
@ -471,7 +471,6 @@ display_possible_values!(DiagnosticFormat);
|
|||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum)]
|
||||||
pub enum Feature {
|
pub enum Feature {
|
||||||
Html,
|
Html,
|
||||||
PdfEmbedding,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
display_possible_values!(Feature);
|
display_possible_values!(Feature);
|
||||||
|
@ -117,7 +117,6 @@ impl SystemWorld {
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|&feature| match feature {
|
.map(|&feature| match feature {
|
||||||
Feature::Html => typst::Feature::Html,
|
Feature::Html => typst::Feature::Html,
|
||||||
Feature::PdfEmbedding => typst::Feature::PdfEmbedding,
|
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
@ -237,7 +237,6 @@ impl FromIterator<Feature> for Features {
|
|||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum Feature {
|
pub enum Feature {
|
||||||
Html,
|
Html,
|
||||||
PdfEmbedding,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A group of related standard library definitions.
|
/// A group of related standard library definitions.
|
||||||
|
@ -272,7 +272,6 @@ impl Packed<ImageElem> {
|
|||||||
.within(loaded)?,
|
.within(loaded)?,
|
||||||
),
|
),
|
||||||
ImageFormat::Vector(VectorFormat::Pdf) => {
|
ImageFormat::Vector(VectorFormat::Pdf) => {
|
||||||
if engine.world.library().features.is_enabled(Feature::PdfEmbedding) {
|
|
||||||
let document = match PdfDocument::new(loaded.data.clone()) {
|
let document = match PdfDocument::new(loaded.data.clone()) {
|
||||||
Ok(doc) => doc,
|
Ok(doc) => doc,
|
||||||
Err(e) => match e {
|
Err(e) => match e {
|
||||||
@ -320,14 +319,6 @@ impl Packed<ImageElem> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ImageKind::Pdf(pdf_image)
|
ImageKind::Pdf(pdf_image)
|
||||||
} else {
|
|
||||||
bail!(
|
|
||||||
span,
|
|
||||||
"embedding PDFs is currently an experimental, opt-in feature";
|
|
||||||
hint: "enable the corresponding feature to try it out";
|
|
||||||
hint: "convert your PDF to SVG instead"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ fn library() -> Library {
|
|||||||
// exactly 100pt wide. Page height is unbounded and font size is 10pt so
|
// exactly 100pt wide. Page height is unbounded and font size is 10pt so
|
||||||
// that it multiplies to nice round numbers.
|
// that it multiplies to nice round numbers.
|
||||||
let mut lib = Library::builder()
|
let mut lib = Library::builder()
|
||||||
.with_features([Feature::Html, Feature::PdfEmbedding].into_iter().collect())
|
.with_features([Feature::Html].into_iter().collect())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Hook up helpers into the global scope.
|
// Hook up helpers into the global scope.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user