mokee commited on
Commit
f44d55c
·
verified ·
1 Parent(s): 98510be

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +10 -12
server.js CHANGED
@@ -24,19 +24,17 @@ app.post('/convert', (req, res) => {
24
 
25
  fs.writeFileSync(inputFile, processedSvg);
26
 
27
- // 2. 改进后的命令链:
28
- // - 使用 --export-plain-svg 确保输出纯净
29
- // - 组合命令:选中所有 -> 对象转路径 -> 描边转轮廓
30
- const actions = [
31
- 'select-all:all',
32
- 'object-to-path',
33
- 'select-all:all',
34
- 'path-outline',
35
- `export-filename:${outputFile}`,
36
- 'export-do'
37
- ].join(';');
38
 
39
- const command = `inkscape "${inputFile}" --actions="${actions}"`;
 
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