Copy link to clipboard
Copied
I am currently trying to convert a jpg image into a pdf with the following code:
function JpgToPdf (doc, img)
{
var myDoc = app.newDoc();
// myDoc.Open("/C/Users/tmuñoz/Desktop/Thuban-Nivel 2.pdf");
myDoc.disclosed = true;
doc.disclosed = true;
newDoc = app.openDoc({
oDoc: doc,
cPath: img,
bUseConv: true
})
newDoc.disclosed = true;
var filePath = "/C/Users/tmuñoz/Desktop/Adobe/temp.pdf";
//MySaveAs(newDoc,"/C/Users/tmuñoz/Desktop/Adobe","Thomas23.pdf");
newDoc.saveAs({
cPath:"/C/Users/tmuñoz/Desktop/Adobe/temp.pdf"
})
newDoc.closeDoc(true);
}
The following code is not working and it sends me the following error:
RaiseError: The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder.
Some ideas to try:
- try saving to a folder with only Latin1 characters (no ñ)
- quit Acrobat, restart and run the code once
- if the file exists delete it and check it has gone
I assume this is called from or part of a trusted function.
Copy link to clipboard
Copied
Some ideas to try:
- try saving to a folder with only Latin1 characters (no ñ)
- quit Acrobat, restart and run the code once
- if the file exists delete it and check it has gone
I assume this is called from or part of a trusted function.