mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
M4.47: PostScript .ai and placeholder-only .ai files say why they can't open
A PostScript file (a .ai saved in an older format or without PDF compatibility, or an .eps, plain or with a binary header) is refused by any name with a clear message instead of a parse error (there is no PostScript importer yet). An .ai whose pages are only placeholder text over the editor's private data (PieceInfo AIPrivateData) is detected and refused with advice to save it with PDF compatibility, instead of opening the placeholder. vectorcraft-pdf: is_postscript(), PdfError::PostScript / PlaceholderOnly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8765d335ec
commit
e0895fd4ba
8 files changed
+116
-2
No files matched your search
@@ -17,6 +17,8 @@ pub struct PdfPage {
|
||||
pub resources: String,
|
||||
/// The content stream (operators, uncompressed).
|
||||
pub content: String,
|
||||
/// More entries of the page dictionary (`/PieceInfo << … >>`).
|
||||
pub entries: String,
|
||||
}
|
||||
|
||||
impl PdfPage {
|
||||
@@ -90,6 +92,9 @@ pub fn pdf_with(pages: &[PdfPage], extra: &[&str], password: Option<&str>) -> Ve
|
||||
if p.rotate != 0 {
|
||||
let _ = write!(d, " /Rotate {}", p.rotate);
|
||||
}
|
||||
if !p.entries.is_empty() {
|
||||
let _ = write!(d, " {}", p.entries);
|
||||
}
|
||||
d.push_str(" >>");
|
||||
objects.push(d.into_bytes());
|
||||
let num = objects.len() + 1;
|
||||
|
||||
Reference in new issue
Block a user