Spaces:
Sleeping
Sleeping
Update server.js
Browse files
server.js
CHANGED
|
@@ -24,19 +24,17 @@ app.post('/convert', (req, res) => {
|
|
| 24 |
|
| 25 |
fs.writeFileSync(inputFile, processedSvg);
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
`export-filename:${outputFile}`,
|
| 36 |
-
'export-do'
|
| 37 |
-
].join(';');
|
| 38 |
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
console.log('Executing:', command); // 在 Runtime Logs 中打印命令
|
| 42 |
|
|
|
|
| 24 |
|
| 25 |
fs.writeFileSync(inputFile, processedSvg);
|
| 26 |
|
| 27 |
+
// 修改 server.js 中的 command 变量部分
|
| 28 |
+
const actions = [
|
| 29 |
+
'select-all:all',
|
| 30 |
+
'object-to-path',
|
| 31 |
+
'path-outline',
|
| 32 |
+
`export-filename:${outputFile}`,
|
| 33 |
+
'export-do'
|
| 34 |
+
].join(';');
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
// 使用 xvfb-run -a 自动分配显示屏启动 Inkscape
|
| 37 |
+
const command = `xvfb-run -a inkscape "${inputFile}" --actions="${actions}"`;
|
| 38 |
|
| 39 |
console.log('Executing:', command); // 在 Runtime Logs 中打印命令
|
| 40 |
|