Skip to content

Commit

Permalink
Fixed border export option with image formats
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohamedin committed Dec 26, 2024
1 parent bb13e5d commit e031c7c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ app.whenReady().then(() =>
format: format,
w: options.width > 0 ? options.width : null,
h: options.height > 0 ? options.height : null,
pageMargin: options.border > 0 ? options.border : 0,
bg: options.transparent ? 'none' : '#ffffff',
from: from,
to: to,
Expand All @@ -575,6 +574,17 @@ app.whenReady().then(() =>
crop: (options.crop && format == 'pdf') ? '1' : '0'
};

options.border = options.border > 0 ? options.border : 0;

if (format === 'pdf')
{
expArgs.pageMargin = options.border;
}
else
{
expArgs.border = options.border;
}

if (options.layers)
{
expArgs.extras = JSON.stringify({layers: options.layers.split(',')});
Expand Down

0 comments on commit e031c7c

Please sign in to comment.