Copy link to clipboard
Copied
This is posted multiple times but with a catch, other posts request how to set the default but they do not mention the app closing. If you open a pdf in photoshop you are met with an import options dialogue box where options are set, you can make changes and hit "ok". Any pdf will now open with those settings prefilled and if not opening the pdf programmatically, the dialogue box will also be there.
When you close the app however some settings change, like dimension unit (pixels vs inches).
Does anyone know how to change these defaults? If it involves editing a program file I can do that.
For example I would need the unit dimensions to be set as inches, not pixels, after closing the app and opening it sometime in the future including system reset / power off:
Copy link to clipboard
Copied
I thought one might be able to work-around with a recorded conversion and Script Events Manager, but it seems the AM-code just disregards the chosen unit and records pixels.
So I see no solution that purely relies on Photoshop at current.
Copy link to clipboard
Copied
Thanks for confirming the dead-end. That is unfortunate.
Copy link to clipboard
Copied
The PDF Processor II script from Paul Riggott doesn't offer the width and height, which may simplify things (apart from possibly not knowing that you have exceeded the 32,000 rasterization pixel limit which then distorts the content):
https://github.com/Paul-Riggott/PS-Scripts/blob/master/PDF%20ProcessorII.jsx
Copy link to clipboard
Copied
Thanks for chiming in, I see you throughout the forum. Before responding to your reply, should I just mark the first reply stating "not possible" as the correct answer? Technically it's not possible to set default import options from what I understand. thank you
I was not aware of the pixel limit- which would negatively impact a tertiary task to this one- nor the pdf tool.
I didn't think of just hard coding the dims into the script...
Since ppi can be set @300, pixel dims could be predefined to get the desired 3.9inx3.9in doc size.
Untested code but for many files with static dimensions and static input directory I guess you could do something like this. 1170x1170 = 3.9in @300. Trying to avoid input dialogues:
#target photoshop
// Set the parameters
var parameters = {
mode: 'RGB Color',
bits: 8,
resolution: 300,
cropTo: 'Bounding Box',
width: 1170,
height: 1170,
pages: 'All pages',
from: 1,
to: 1,
fileType: 'Single File',
filePath: 'C:/pdfs/files',
saveToOriginalFolder: false,
outputFolder: 'C:/output',
resizeToFit: false,
resizeWidth: 0,
resizeHeight: 0,
action: {
runAction: false,
actionSet: '',
actionName: ''
},
fileNameOptions: 'Document Name',
sequenceStart: 1,
sequenceLength: 4,
newFileName: '',
flattenDocument: false,
saveOptions: {
tif: {
enable: true,
compression: 'LZW'
},
psd: false,
png: false,
jpg: false,
pdf: false,
saveForWeb: false,
targa: false,
printOnly: false
}
};
// Process PDF files
function processPDF(filePath) {
// Your PDF processing logic here
$.writeln("Processing PDF file: " + filePath);
}
// Main function
function main() {
// Set up parameters and process PDF files
var pdfFolder = Folder(parameters.filePath);
var fileList = pdfFolder.getFiles("*.pdf");
// Iterate over each PDF file
for (var i = 0; i < fileList.length; i++) {
var pdfFile = fileList[i];
processPDF(pdfFile);
}
}
// Run the main function
main();