DavidSmerda
Explorer
DavidSmerda
Explorer
Activity
Mar 18, 2025
03:05 AM
Hello (@S. S) Souvik, thank you very much for your answer and time. I have looked into the Preflight tools and did not find the aforementioned profile. Perhaps it isn't included in the base libraries? I have checked profiles as well as fixups in all the available libraries: Acrobat 2015, Essentials, PDF Standards, Prepress... Nothing popped up. I have also checked the custom fixups, but nothing relevant either: Sidenote: removing the XMP metadata will also remove the PDF/X-6 compliance. Can you provide further assistance? Thank again for your time, David
... View more
Mar 17, 2025
03:42 PM
Okay, so something like this below is what you're after? Sorry for the quality, but it should be what you're describing at the top (ie. chenge of color without changing the color values). It was captured on the latest version of Acrobat Pro. I have sent you three files. The first one is the one I have open in the picture above. No PDF/X standard (and no Document level output intent) behaves like this. The two other files (B and C) are just a copies of the first file with one notable exception, they conform with PDF/X-6 specification, thus have an embedded Output Intent on a Document Level (file B) or Page Leve (file C). The moment you embed an Output Intent to the document (be it on a document level or page level), all the DeviceCMYK, uncalibrated objects will act as objects with the Output Intent profile calibration (ie. will be converted to simulation profile with numbers change). That's why you probably encountered something like this: Should it be that way? I don't know, but it behaved consistently throughout the years (at least for me). You should be able to test this with your own files via the Preflight tool (as you can remove the XMP metadata with the embedded output intent over there). Also, sorry about the assumption that your clients are sending you files with different export setting. Best Regards, David
... View more
Mar 15, 2025
05:38 AM
Hello there, I'm using Output Preview on a daily basis and do not remember it changing over the years. Perhaps it is related to the files you receive from your clients? They might have changed their export settings? To test that, I have prepared three PDF files; could you please open them in Acrobat and report if one of them behave in the way you remember? This might be a longshot but let me know what you find out, David
... View more
Mar 13, 2025
03:33 PM
OK, so after a lot of time, I have come to a conclusion that the way JavaScript changes the page boxes is kind of problematic. The only solution to this was a creation of a custom preflight profile that would validate those boxes after the JavaScript changes them. From that point on, the posted script works as intended. Hope it helps someone else. David
... View more
Mar 13, 2025
03:21 PM
Hello, does anyone know how I could remove the Document information dictionary and Document info fields other than modification date from a PDF file created in InDesign? The PDF/X-6 compliance check in Preflight tool gives the following two issues: I tried to find somethin relevant in the custom fixups menu, but nothing that would fix these issues. Thanks for your time, David
... View more
Mar 13, 2025
03:09 PM
Hello there, so your only worry is that the CropBox starts at 0 from all 4 sides in the Set Page Boxes dialog, right? All the page boxes in the Set Page Boxes dialog are measured from the MediaBox. You should be able to set up a Preflight fixup that would remove white margins by adjusting the MediaBox (instead of the CropBox as the Set Page Boxes dialog does). Please follow these steps in the image below: You can run the fixup on any file via the Preflight tool and it should remove the white margins. Hope it helps, David
... View more
Feb 21, 2025
12:46 PM
I will keep that in mind. Thanks again for your time. PS: Are you still working on that article about pre-filling the Save as dialog? It would help me tremendously on my next project.
... View more
Feb 21, 2025
02:46 AM
OK, it was indeed Acrobat Reader. Thanks everyone for your valuable time and a lot of useful insights into JavaScript.
... View more
Feb 20, 2025
09:26 AM
The same. I will as them again about the Acrobat Reader. It seems to be it.
... View more
Feb 20, 2025
09:10 AM
A have looked the PDF reference and the fields would have different names. Would that work if the importTextData() works with field names? I will check that out later tonight, so thanks for mentioning it.
... View more
Feb 20, 2025
08:56 AM
UPDATE from the person: They tried it both with an open document and without. On a question “if they are using Acrobat Reader or not” they did not respond. I guess they are using Acrobat Pro, they are using it professionaly and work in printing.
... View more
Feb 20, 2025
08:50 AM
I have thought about creating a template from the source file but I quite like the functionality of creating a new document instead of modifyin the original. That way, the user can safely return to the original if the resulting file does not meet their expectations.
... View more
Feb 20, 2025
08:45 AM
I have thought about that but it works when you check the Enable menu items JavaScript execution privileges in the Preferences. When you check that, it does not require Privileged context. I have tried it on multiple machines. Also, the console would mentiontion this: I will post a new reply at the top. I have some more information from that person.
... View more
Feb 20, 2025
04:17 AM
You are correct. What confused me is that the JavaScript reference describes the cPath parameter as a device-independent path to the file. I tested inputting the base string from browseFromFileToSubmit(), which is device-dependent, and it works as well. Guess I must prefer testing over blindly trusting the JavaScript reference. Thanks again for pointing that out.
... View more
Feb 20, 2025
03:48 AM
Thanks for your time try67, I will create a new post later today about it, perhaps someone encountered it in the past. Some imposition plugins also use this (PLDA from Konika comes to my mind). But it may not be possible with JavaScript. plugins usually use C#.
... View more
Feb 20, 2025
03:43 AM
Unfortunately yes, I was also surprised when the output started with D:\... instead of the native D/... Not sure if it is necessary on MAC, though.
... View more
Feb 20, 2025
03:11 AM
Excellent point. I will include this line into the final code. My solution, after Bernd mentioned it, was to include an if() statement which would show an alert message while running the menu Item without a document being open.
... View more
Feb 20, 2025
03:03 AM
OK, that would also verify the point that try67 made about the Acrobat Reader. Would you mind checking the code (if you have MAC OS, that is), if the MAC file path is correctly converted to the Acrobat Device Independent Path?
... View more
Feb 20, 2025
02:57 AM
Thats the strange thing, the new file does not have any title at all: Also, I have also checked the Always use filename as a document title in the preferences. What I would like to achieve is after the user saves the document, the Save as dialog appears and the original (source document) file name will be pre-written instead of random string.
... View more
Feb 20, 2025
02:50 AM
True, Thanks for pointing that out. I will inform the person that they should have an opened document.
... View more
Feb 20, 2025
02:21 AM
Although I'm quite certain they have access to Acrobat Pro, I'm not sure if they are using Acrobat Reader on their own machine. I will ask them about that. Also, in the code there are some issues with using the "this" keyword after creating the new document. At that point, "this" might not refer to the old file any longer, so it's better to keep a variable referencing it, and use that one, instead. By @try67 I never never encountered this, so thank you for pointing that out. After checking the JavaScript Reference page and it indeed mention the word “usually”. var sDoc = this; Will this line of code suffice? Also, a related question to the script, but unrelated to this problem. I noticed that when you combine files, the file name mentioned in the tab is Binder1.pdf (also present after you activate the Save as dialog), but under the properties tab, the name is a temporary file with a random string of characters. Is there a way how to achieve something similar after extracting pages?
... View more
Feb 20, 2025
01:38 AM
Hello, I have been editing a script originally made by Karl Heinz (link to the original script) and it works flawlessly on Windows OS. But after sharing this script with another pearson on MAC OS, they can't make it work. I have made sure that the obtained file path would be compatible with both Windows and MAC OS via the replace() method. I can't check it personally (I do not own/have access to MAC) and further investigation is quite delayed due to a different time-zone. Could anyone check the script and tell me what's going on? app.addMenuItem ({cName: "DataMerge", cParent: "Edit", cExec: "DataMergeFx()"});
function DataMergeFx() {
var sFilePath = this.path;
var sMetadata = this.metadata;
var newDoc = this.extractPages(0);
newDoc.metadata = sMetadata;
var tmpField = newDoc.addField("Directory", "text", 0, [0,0,100,100]);
tmpField.hidden = true;
tmpField.fileSelect = true;
tmpField.browseForFileToSubmit();
var txtValue = tmpField.valueAsString;
var txtPath = "/" + txtValue.replace(/:\\/g,"/").replace(/\\/g,"/").replace(/:/g,"/");
var err = 0;
var idx = 0;
while (err == 0) {
err = this.importTextData(txtPath, idx);
newDoc.flattenPages();
if (err == -1)
app.alert("Error: Cannot Open File");
else if (err == -2)
app.alert("Error: Cannot Load Data");
//else if (err == -3) {}
else if (err == 1)
app.alert("Warning: User Cancelled File Select");
else if (err == 2)
app.alert("Warning: User Cancelled Row Select");
else if (err == 3)
app.alert("Warning: Missing Data");
else if (err == 0) {
newDoc.insertPages({cPath: sFilePath});
idx++;
}
}
newDoc.deletePages(0);
var nPages = newDoc.numPages;
for(i = nPages - 1; i>0; i--) {
newDoc.movePage(0, i);
}
this.resetForm();
this.dirty = false;
} The person has enabled menu items JavaScript execution privileges and in the last conversation, they mentioned that the console error message looks like this: TypeError: this.extractPages() is not a function
5:Folder-Level:App:DataMerge.js ...which does not make sense to me. Nithing like this appears on Windows and the extractPages() method is well defined. Everything (the script file and a testing file with random namelist) can be accessed via this link. Thanks a lot, David
... View more
Jan 17, 2025
03:07 AM
It is clearly changing some values, no doubt about that, but unfortunately the watermarks does not seem to respect the ArtBox edited via JavaScript. I will post the whole code here in the attached file. The script takes a document and impose it for sewn binding. I got it working using the CropBox. But this solution is not ideal. I do not want to change the appearance of the original document and the ArtBox is great for that (it is the only PageBox that do not influence the printing process and can be safely ignored if left as is after the script). If I use the CropBox, everything works. The Artbox breaks things (you can test if by replacing the variable in the main function). I have found a solution for the crop box in that the script extract the pages first and then replace the original pages (with edited CropBox) after the script is done. Also sets the dirty flag to false so the document appears as the original and do not require saving afterwards. I may have found a solution in this simple case, but I plan on implementing more functions with a custom dialog window that would enable the user to impose the pages in more ways (Step & Repeat, N-Up pages, etc.) and I'm afraid that this solution might not work in other cases. Thanks for your time and please let me know if something comes to your mind why the ArtBox does not work or if you have an alternative solution to the clean-up process after the script is done. David
... View more
Jan 16, 2025
02:45 PM
Hello, I have checked the links you provided and they are on point, thanks for posting them. I revised the code a bit but to no avail. And then I checked the javascript console. I have a strange, unaccountable feeling that Acrobat is lying to me, right before my eyes. Let me explain. I have opened the document I included in the original post. Checked the console with these commands and results: this.getPageBox('Art',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Bleed',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Trim',0);
8.503936767578125,291.968994140625,221.1020050048828,8.503936767578125
this.getPageBox('Crop',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Media',0);
0,300.47198486328125,229.6060028076172,0 Here is a screenshot: After that, I executed the script from the Menu Item and got these results: this.getPageBox('Art',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Bleed',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Trim',0);
8.503936767578125,291.968994140625,221.1020050048828,8.503936767578125
this.getPageBox('Crop',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Media',0);
0,300.47198486328125,229.6060028076172,0
//After the script
this.getPageBox('Art',0);
8.503936767578125,300.47198486328125,229.6060028076172,0
this.getPageBox('Bleed',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Trim',0);
8.503936767578125,291.968994140625,221.1020050048828,8.503936767578125
this.getPageBox('Crop',0);
0,300.47198486328125,229.6060028076172,0
this.getPageBox('Media',0);
0,300.47198486328125,229.6060028076172,0 A proof of that: Not only are the visual guides off (the red rectangle for the ArtBox should be on the green TrimBox on the left - according to the javascript console) but the Set Page Boxes tool in acrobat does not register this change either: Do you know what is happening? The script is obviously working; if I replace the ArtBox with CropBox inside the script, the change is apparent: Therefore the problem must lie inside the Acrobat by itself. Please, let me know if something relevant comes to your mind, David
... View more
Jan 16, 2025
10:02 AM
Hello, I have been working on a script that would change the ArtBox of the page but it does not seems to be working. Here is a sample script: for (var o = 0; o<this.numPages; o++) {
var crBox = this.getPageBox('Bleed',o);
var trBox = this.getPageBox('Trim',o);
var rightBleed = [trBox[0], crBox[1], crBox[2], crBox[3]];
var leftBleed = [crBox[0], crBox[1], trBox[2], crBox[3]];
if ( o % 2 == 0 ) {
this.setPageBoxes({
cBox: 'Art',
nStart: o,
rBox: rightBleed
});
}
else {
this.setPageBoxes({
cBox: 'Art',
nStart: o,
rBox: leftBleed
});
}
} The idea goes like this; for every odd page, set the ArtBox to BleedBox except the left side (use TrimBox instead). For even pages flip the sides. But it does nothing in return. Strangely, if I replace the ArtBox with MediaBox like this: for (var o = 0; o<this.numPages; o++) {
var crBox = this.getPageBox('Bleed',o);
var trBox = this.getPageBox('Trim',o);
var rightBleed = [trBox[0], crBox[1], crBox[2], crBox[3]];
var leftBleed = [crBox[0], crBox[1], trBox[2], crBox[3]];
if ( o % 2 == 0 ) {
this.setPageBoxes({
cBox: 'Media',
nStart: o,
rBox: rightBleed
});
}
else {
this.setPageBoxes({
cBox: 'Media',
nStart: o,
rBox: leftBleed
});
}
} it suddenly works just fine. Any other change Crop, Bleed or Trim does not work either. Can anyone provide an insight into this? Why ArtBox? Well I have discovered that watermarks are dependant on it and ignore any other page box. At least that is the result of my testing. I have created a test file for testing as well as a simple script that adds the same function with a menu item (under Edit) to run it (can't upload .js so I just change the extension to .txt). Please, let me know if you know how to make it working. I am a beginner in javascript, so any advice or insight is appreciated. Best Regards, David
... View more
Jan 16, 2025
02:47 AM
Hello Amal, thanks for your time for answering. I thought as much, just wanted confirmation. The company, I work for, limited the number of seats in our CC suite and I was looking for a way to make Acrobat Reader a little bit more useful for our expedition team (by checking the Spot colours and forwarding orders to the right production team). I might have found an alternative solution. I have made a custom preflight profile that will create layers based on Spot colors. I presume layers are visible in the Acrobat Reader to the same extend as inside Acrobat Pro? Nevertheless, thanks again for your valuable insights, David
... View more
Jan 14, 2025
03:39 AM
Hello, I would like to ask if it is possible to list all spot colors in Acrobat Reader. If not by integrated tools, perhaps via script? I checked the Acrobat JavaScript reference but could not find anything related to spot colors. Thanks for your time, David
... View more