PDF/.ai import: the PostScript file error names File › Open and File › Place, which read the file

document.pdfInfo and clipboard.importPdf, given a PostScript file (an
EPS, or an .ai in an older PostScript format), failed with "this is a
PostScript file (...), which can't be opened yet: save it as PDF,
PDF-compatible .ai or SVG". document.open and file.place read the same
file through the EPS reader. The error told users to convert a file that
VectorCraft opens.

The error now says the file is not a PDF and that File › Open and
File › Place read it as EPS. The 13 catalogs that carry the message get
the new text.
This commit is contained in:
dotCooCoo
2026-10-16 03:36:20 +07:00
committed by bflatastic
parent f3b4c3ec78
commit 31ffbb2152
15 changed files with 34 additions and 14 deletions
@@ -166,6 +166,26 @@ fn a_postscript_ai_file_says_it_cannot_be_opened_yet() {
assert!(s.active().is_none());
}
/// PostScript given where a PDF is read (`document.pdfInfo`, `clipboard.importPdf`) is refused
/// with an error that names File › Open and File › Place, and both of those read the file.
#[test]
fn postscript_read_as_a_pdf_names_open_and_place() {
let ps = b"%!PS-3.0\n%%BoundingBox: 0 0 100 100\n%%EndComments\n1 0 0 setrgbcolor 10 10 50 50 rectfill\nshowpage\n%%EOF\n";
let mut s = Session::new();
s.execute("file.new", &json!({})).unwrap();
for cmd in ["document.pdfInfo", "clipboard.importPdf"] {
let e = s.execute(cmd, &json!({"dataBase64": b64(ps)})).unwrap_err().to_string();
assert!(e.contains("PostScript") && e.contains("not a PDF: File › Open and File › Place read it as EPS"), "{cmd}: {e}");
assert!(!e.contains("can't be opened"), "{cmd}: {e}");
}
for name in ["legacy.ai", "art.eps"] {
let r = s.execute("document.open", &json!({"name": name, "dataBase64": b64(ps)})).unwrap();
assert_eq!(r["warnings"], json!([]), "{name}: {r}");
let r = s.execute("file.place", &json!({"name": name, "dataBase64": b64(ps)})).unwrap();
assert_eq!(r["ids"].as_array().map(Vec::len), Some(1), "{name}: {r}");
}
}
/// A page showing only text, with an editor's private data when `private`.
fn text_page(private: bool, also: &str) -> PdfPage {
PdfPage {
+1 -1
View File
@@ -215,7 +215,7 @@ pub enum PdfError {
#[error("page {0} does not exist (the PDF has {1})")]
BadPage(usize, usize),
#[error(
"this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG"
"this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS"
)]
PostScript,
#[error(
+1 -1
View File
@@ -4268,7 +4268,7 @@ imageTrace Outline Obrys
@msg this file's PostScript couldn't be read ({why}): {what} PostScript tohoto souboru nelze přečíst ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens tento formát pojme jednu pracovní plochu: více jich exportujte jako PDF nebo pomocí document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that toto je výkres DWG, který nelze přečíst: uložte jej v aplikaci CAD jako ASCII DXF a otevřete ten
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG toto je soubor PostScript (.ai uložený ve starším formátu nebo bez kompatibility s PDF, nebo soubor EPS), který zatím nelze otevřít: uložte jej jako PDF, .ai kompatibilní s PDF nebo SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS toto je soubor PostScript (.ai uložený ve starším formátu nebo bez kompatibility s PDF, nebo soubor EPS), nikoli PDF: Soubor › Otevřít a Soubor › Umístit jej načtou jako EPS
@msg this is not a PostScript file toto není soubor PostScript
@msg tool shortcuts must be a single key (optionally with Shift) zkratky nástrojů musí být jediná klávesa (volitelně se Shift)
@msg truncated zkráceno
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3876,7 +3876,7 @@ theme Appearance Erscheinungsbild
@msg this file's PostScript couldn't be read ({why}): {what} das PostScript dieser Datei konnte nicht gelesen werden ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens dieses Format fasst eine Zeichenfläche: Exportieren Sie mehrere als PDF oder mit document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that dies ist eine DWG-Zeichnung, die nicht gelesen werden kann: Speichern Sie sie in der CAD-App als ASCII-DXF und öffnen Sie diese Datei
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG dies ist eine PostScript-Datei (eine .ai-Datei in einem älteren Format oder ohne PDF-Kompatibilität oder eine EPS-Datei), die noch nicht geöffnet werden kann: Speichern Sie sie als PDF, als PDF-kompatible .ai-Datei oder als SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS dies ist eine PostScript-Datei (eine .ai-Datei in einem älteren Format oder ohne PDF-Kompatibilität oder eine EPS-Datei), keine PDF-Datei: Datei › Öffnen und Datei › Platzieren lesen sie als EPS
@msg this is not a PostScript file dies ist keine PostScript-Datei
@msg tool shortcuts must be a single key (optionally with Shift) Tastaturbefehle für Werkzeuge müssen aus einer einzelnen Taste bestehen (optional mit Shift)
@msg truncated abgeschnitten
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3973,7 +3973,7 @@ axis Both Ambos
@msg this file's PostScript couldn't be read ({why}): {what} no se pudo leer el PostScript de este archivo ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens este formato admite una sola mesa de trabajo: exporta varias como PDF o con document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that este es un dibujo DWG, que no se puede leer: guárdalo desde la aplicación de CAD como DXF ASCII y abre ese archivo
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG este es un archivo PostScript (un .ai guardado en un formato antiguo o sin compatibilidad con PDF, o un archivo EPS), que todavía no se puede abrir: guárdalo como PDF, .ai compatible con PDF o SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS este es un archivo PostScript (un .ai guardado en un formato antiguo o sin compatibilidad con PDF, o un archivo EPS), no un PDF: Archivo › Abrir y Archivo › Colocar lo leen como EPS
@msg this is not a PostScript file este no es un archivo PostScript
@msg tool shortcuts must be a single key (optionally with Shift) los atajos de herramientas deben ser una sola tecla (opcionalmente con Shift)
@msg truncated truncado
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3970,7 +3970,7 @@ axis Both Les deux
@msg this file's PostScript couldn't be read ({why}): {what} impossible de lire le PostScript de ce fichier ({why}) : {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens ce format ne contient qu’un plan de travail : exportez-en plusieurs au format PDF ou avec document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that c’est un dessin DWG, qui ne peut pas être lu : enregistrez-le depuis l’application de CAO au format DXF ASCII et ouvrez ce fichier
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG c’est un fichier PostScript (un .ai enregistré dans un ancien format ou sans compatibilité PDF, ou un fichier EPS), qui ne peut pas encore être ouvert : enregistrez-le au format PDF, .ai compatible PDF ou SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS c’est un fichier PostScript (un .ai enregistré dans un ancien format ou sans compatibilité PDF, ou un fichier EPS), pas un PDF : Fichier › Ouvrir et Fichier › Importer le lisent comme un EPS
@msg this is not a PostScript file ce n’est pas un fichier PostScript
@msg tool shortcuts must be a single key (optionally with Shift) les raccourcis d’outils doivent être une seule touche (éventuellement avec Maj)
@msg truncated tronqué
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -4645,7 +4645,7 @@ imageTrace Outline Körvonal
@msg this file's PostScript couldn't be read ({why}): {what} a fájl PostScript-tartalma nem olvasható ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens ez a formátum egy rajztáblát tárol: többet PDF-ként vagy a document.exportForScreens paranccsal exportálj
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that ez DWG-rajz, amely nem olvasható: mentsd ASCII DXF-ként a CAD-alkalmazásból, és azt nyisd meg
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG ez PostScript-fájl (régebbi formátumban vagy PDF-kompatibilitás nélkül mentett .ai, illetve EPS), amely még nem nyitható meg: mentsd PDF-ként, PDF-kompatibilis .ai-ként vagy SVG-ként
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS ez PostScript-fájl (régebbi formátumban vagy PDF-kompatibilitás nélkül mentett .ai, illetve EPS), nem PDF: a Fájl › Megnyitás és a Fájl › Elhelyezés EPS-ként olvassa be
@msg this is not a PostScript file ez nem PostScript-fájl
@msg this isn't a flat-colour logo ({_1}% of its solid areas match a few flat colours), so Flat Logo mode would turn its gradients into patches: use Color mode instead ez nem egyszínű logó (az egyszínű területeinek csak ennyi része illik néhány alapszínhez: {_1}%), így az Egyszínű logó mód foltokká alakítaná a színátmeneteit: használd inkább a Színes módot
@msg this kind of brush has no options dialog yet ennek az ecsetfajtának még nincs beállítási párbeszédablaka
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3975,7 +3975,7 @@ axis Both Entrambi
@msg this file's PostScript couldn't be read ({why}): {what} impossibile leggere il PostScript di questo file ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens questo formato contiene una sola tavola da disegno: esportane più di una come PDF o con document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that questo è un disegno DWG, che non può essere letto: salvalo dall'app CAD come DXF ASCII e apri quel file
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG questo è un file PostScript (un .ai salvato in un formato precedente o senza compatibilità PDF, oppure un file EPS), che non può ancora essere aperto: salvalo come PDF, .ai compatibile con PDF o SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS questo è un file PostScript (un .ai salvato in un formato precedente o senza compatibilità PDF, oppure un file EPS), non un PDF: File › Apri e File › Inserisci lo leggono come EPS
@msg this is not a PostScript file questo non è un file PostScript
@msg tool shortcuts must be a single key (optionally with Shift) le scelte rapide degli strumenti devono essere un singolo tasto (eventualmente con Shift)
@msg truncated troncato
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3880,7 +3880,7 @@ theme Appearance 外観
@msg the PDF is password-protected: give its password この PDF はパスワードで保護されています: パスワードを入力してください
@msg the PDF password is wrong PDF のパスワードが正しくありません
@msg the file holds only a placeholder page, not its art (it was saved without PDF compatibility): save it again with PDF compatibility on, or as PDF or SVG ファイルには仮のページだけが含まれ、アートは含まれていません (PDF 互換なしで保存されています): PDF 互換をオンにして保存し直すか、PDF または SVG として保存してください
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG これは PostScript ファイル (古い形式または PDF 互換なしで保存された .ai、または EPS ファイル) のため、まだ開けません: PDF、PDF 互換の .ai、または SVG として保存してください
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS これは PDF ではなく PostScript ファイル (古い形式または PDF 互換なしで保存された .ai、または EPS ファイル) です: 「ファイル › 開く」と「ファイル › 配置」で EPS として読み込めます
@msg unsupported: {0} 対応していません: {0}
@msg a page is missing 見つからないページがあります
@msg a page tree kid isn't a reference ページツリーの子要素が参照になっていません
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3858,7 +3858,7 @@ theme Appearance 외관
@msg the PDF is password-protected: give its password PDF가 암호로 보호되어 있습니다: 암호를 입력하세요
@msg the PDF password is wrong PDF 암호가 올바르지 않습니다
@msg the file holds only a placeholder page, not its art (it was saved without PDF compatibility): save it again with PDF compatibility on, or as PDF or SVG 파일에 아트웍 없이 대체 페이지만 들어 있습니다(PDF 호환 없이 저장됨): PDF 호환을 켜고 다시 저장하거나 PDF나 SVG로 저장하세요
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG PostScript 파일(이전 형식이나 PDF 호환 없이 저장한 .ai, 또는 EPS 파일)이라 아직 열 수 없습니다: PDF, PDF 호환 .ai 또는 SVG로 저장하세요
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS PDF가 아니라 PostScript 파일(이전 형식이나 PDF 호환 없이 저장한 .ai, 또는 EPS 파일)입니다: 파일 › 열기와 파일 › 가져오기는 이 파일을 EPS로 읽습니다
@msg unsupported: {0} 지원되지 않음: {0}
@msg a page is missing 페이지가 없습니다
@msg a page tree kid isn't a reference 페이지 트리 하위 항목이 참조가 아닙니다
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -4084,7 +4084,7 @@ imageTrace Outline Kontur
@msg this file's PostScript couldn't be read ({why}): {what} nie udało się odczytać kodu PostScript tego pliku ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens ten format mieści jeden obszar kompozycji: kilka wyeksportuj jako PDF lub za pomocą document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that to rysunek DWG, którego nie można odczytać: zapisz go w programie CAD jako ASCII DXF i otwórz ten plik
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG to plik PostScript (.ai zapisany w starszym formacie lub bez zgodności z PDF albo plik EPS), którego nie można jeszcze otworzyć: zapisz go jako PDF, .ai zgodny z PDF lub SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS to plik PostScript (.ai zapisany w starszym formacie lub bez zgodności z PDF albo plik EPS), a nie PDF: Plik › Otwórz i Plik › Umieść odczytują go jako EPS
@msg this is not a PostScript file to nie jest plik PostScript
@msg tool shortcuts must be a single key (optionally with Shift) skróty narzędzi muszą być pojedynczym klawiszem (opcjonalnie z Shift)
@msg truncated obcięty
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3573,7 +3573,7 @@ axis Both Ambos
@msg this file's PostScript couldn't be read ({why}): {what} não foi possível ler o PostScript deste arquivo ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens este formato comporta uma prancheta: exporte várias como PDF ou com document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that este é um desenho DWG, que não pode ser lido: salve-o no aplicativo de CAD como DXF ASCII e abra esse arquivo
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG este é um arquivo PostScript (um .ai salvo em formato mais antigo ou sem compatibilidade com PDF, ou um arquivo EPS), que ainda não pode ser aberto: salve-o como PDF, .ai compatível com PDF ou SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS este é um arquivo PostScript (um .ai salvo em formato mais antigo ou sem compatibilidade com PDF, ou um arquivo EPS), não um PDF: Arquivo › Abrir e Arquivo › Colocar o leem como EPS
@msg this is not a PostScript file este não é um arquivo PostScript
@msg tool shortcuts must be a single key (optionally with Shift) os atalhos de ferramenta devem ser uma única tecla (opcionalmente com Shift)
@msg truncated truncado
Can't render this file because it contains an unexpected character in line 6 and column 47.
+1 -1
View File
@@ -3971,7 +3971,7 @@ axis Both Оба
@msg this file's PostScript couldn't be read ({why}): {what} PostScript этого файла невозможно прочитать ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens этот формат содержит одну монтажную область: экспортируйте несколько как PDF или с помощью document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that это чертёж DWG, который невозможно прочитать: сохраните его из приложения CAD как ASCII DXF и откройте его
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG это файл PostScript (.ai, сохранённый в старом формате или без совместимости с PDF, либо файл EPS), который пока невозможно открыть: сохраните его как PDF, .ai с совместимостью с PDF или SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS это файл PostScript (.ai, сохранённый в старом формате или без совместимости с PDF, либо файл EPS), а не PDF: Файл › Открыть и Файл › Поместить читают его как EPS
@msg this is not a PostScript file это не файл PostScript
@msg tool shortcuts must be a single key (optionally with Shift) сочетания инструментов должны быть одной клавишей (необязательно с Shift)
@msg truncated усечено
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1 -1
View File
@@ -3959,7 +3959,7 @@ axis Both Обидві
@msg this file's PostScript couldn't be read ({why}): {what} PostScript цього файлу неможливо прочитати ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens цей формат містить одну монтажну область: експортуйте кілька як PDF або за допомогою document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that це креслення DWG, яке неможливо прочитати: збережіть його з CAD як ASCII DXF і відкрийте його
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG це файл PostScript (.ai, збережений у старому форматі або без сумісності з PDF, або файл EPS), який поки неможливо відкрити: збережіть його як PDF, .ai із сумісністю з PDF або SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS це файл PostScript (.ai, збережений у старому форматі або без сумісності з PDF, або файл EPS), а не PDF: Файл › Відкрити та Файл › Розмістити читають його як EPS
@msg this is not a PostScript file це не файл PostScript
@msg tool shortcuts must be a single key (optionally with Shift) поєднання інструментів має бути однією клавішею (необов’язково з Shift)
@msg truncated усічено
Can't render this file because it contains an unexpected character in line 715 and column 40.
+1 -1
View File
@@ -4282,7 +4282,7 @@ theme Appearance Giao diện
@msg this file's PostScript couldn't be read ({why}): {what} PostScript của tệp này không thể đọc được ({why}): {what}
@msg this format holds one artboard: export several as PDF or with document.exportForScreens định dạng này chứa một bảng vẽ: xuất nhiều bảng vẽ dưới dạng PDF hoặc với document.exportForScreens
@msg this is a DWG drawing, which can't be read: save it from the CAD app as an ASCII DXF and open that đây là bản vẽ DWG, không thể đọc: lưu từ ứng dụng CAD dưới dạng ASCII DXF và mở tệp đó
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), which can't be opened yet: save it as PDF, PDF-compatible .ai or SVG đây là tệp PostScript (tệp .ai lưu ở định dạng cũ hơn hoặc không có tương thích PDF, hoặc tệp EPS), chưa thể mở: lưu dưới dạng PDF, .ai tương thích PDF hoặc SVG
@msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS đây là tệp PostScript (tệp .ai lưu ở định dạng cũ hơn hoặc không có tương thích PDF, hoặc tệp EPS), không phải PDF: Tệp › Mở và Tệp › Đặt đọc tệp này dưới dạng EPS
@msg this is not a PostScript file đây không phải là tệp PostScript
@msg this isn't a flat-colour logo ({_1}% of its solid areas match a few flat colours), so Flat Logo mode would turn its gradients into patches: use Color mode instead đây không phải là logo màu phẳng ({_1}% vùng đặc khớp với một vài màu phẳng), Flat Logo mode sẽ chuyển các chuyển sắc thành mảng: hãy dùng chế độ Color thay thế
@msg this PostScript file can't be read ({why}): save it as PDF or SVG in the app that made it tệp PostScript này không thể đọc được ({why}): lưu dưới dạng PDF hoặc SVG trong ứng dụng đã tạo nó
Can't render this file because it contains an unexpected character in line 3705 and column 10.