Builder SaveFile

Doesn’t work this code (docbuilder script files):

var jsVar=“header.docx”;
builder.SaveFile(“docx”, jsValue(jsVar));
builder.CloseFile();

This code work properly:
builder.SaveFile(“docx”, “header.docx”);
builder.CloseFile();

How I can send type of file and name with extension using arguments?

DocumentBuilder version: last version (7.2)
Installation method: deb
OS: linux mint (last version)

Hello,
Thank you for reporting the issue. We are analyzing it. I will post here once we have some results.

We have registered a bug (number 59905) in our internal tracker. We’ll notify you when the fix is released. Sorry for the inconvenience.

Hi, we have an update for this. In order to use jsValue in builder.SaveFile, you need to wrap it with quotation marks:

builder.CreateFile("docx");
var jsVar = "test.docx";
builder.SaveFile("docx", "jsValue(jsVar)");
1 Like