Copy link to clipboard
Copied
FrameMaker 2022. Should be simple, but I couldn't find an example.
I don't want to use File>Save as PDF. Some of our authors don't have the Adobe PDF printer and it errors out, and I've also had it hang sometimes.
I don't want to use Doc.SilentPrintDoc() b/c we don't always use the defaults, and also the selected printer might be Adobe PDF, Power PDF, Microsoft Print to PDF, and that might NOT be the default printer on the users system.
I thought Fcodes([FCodes.KbdPrint]); would at least bring up the menu, but it doesn't seem to.
Ideallly, what I want is to display the menu with the following settings:
- Page Range - All
- Do Not Skip Blank Pages
- Do Not Print to File
- Do Not Generate Acrobat Data
- User will select the correct printer
- Also - some of our documents use an odd paper size (8x5 inches). The documents should be printed at this size. I think the default menu picks this up from the document settings, and if not, I think it would need to be from the printer settings, but we can work around this if necessary.
Example attached:
3 Correct answers
Documents have a bunch of printer properties that you can set. Did you try these?
This works:
Fcodes ([FCodes.KBD_PRINT]);
@frameexpert- Got it, but it wasn't easy. For me, I went to https://adobe.fandom.com/wiki/Adobe_FrameMaker_Developer_Kit - follow the link to https://web.archive.org/web/20181023130035/https://www.adobe.com/devnet/framemaker.html - That downloads, but it gets 182 of 183 MB and fails with a network errror, but it leaves a .zip.part file. Rename that to .zip and you can open it and the file is inside the zip at \products\FDK\FDK15.zip\1\Application\include.
I'm attaching it here, unless that isn't
Copy link to clipboard
Copied
@Jeff_Coatsworth - I'll check into it. Managed corporate install, so it might take a while. I remember it installed with FM 11, and it seems odd that Adobe would charge $$$ for FrameMaker but then to create PDF's you have to pay $$$ for Acrobat or use 3rd-party solutions.
Copy link to clipboard
Copied
You guys go to town on this scripting stuff, but I still can't see the use-case for building this. Are your FM authors that bad that they can't figure out how to File > Print > make some choices & create some output? Just scratching my head....
Copy link to clipboard
Copied
In some cases, scripting can be overkill, but what if you were doing the same thing many times a day? A one-click solution could save a lot of time.
Copy link to clipboard
Copied
Ok, I guess - I don't think I've printed something out from my FM content in the last 6 months - oh, maybe a page or two for somebody to review. Not a high-demand action in my world. Certainly YMMV - Fill 'yer boots! 🤣
Copy link to clipboard
Copied
You'd be surprised - but I've been burned by it myself sometimes.
- Pretty easy to not check "All pages" b/c the default is the current page, and then the lead gets a 1-page document to review. Then the writer has to make a new PDF to submit to the lead, etc.
- Additional reason is this will be called from a different script. So no need to pop-up a message with "Changes implemented, please create PDF's now). No need for the user to have to click Ctrl-P and verify the settings are correct, etc.
Copy link to clipboard
Copied
@frameexpert - I'm back to this with two questions:
First, how can I set the PrinterName.
doc.PrinterName = "Microsoft Print to PDF";
doesn't generate an error, but seems to be ignored.
The code you posted earlier:
F_ObjHandleT docId;
docID = F_ApiGetID(0, FV_SessionID, FP_ActiveDoc);
F_ApiSetString(FV_SessionID, docID, FP_PrinterName, "ps11");
Gives me an error of "Expected: ;" on the first line, but I don't know where it thinks the ; belongs.
Second question: Since I cant set the printername, I can't test what happens if I set it to something that doesn't exist, but I assume it would give me an error when I tried to print. How can I query what printers are installed?
I'm looking for something similar to:
If (doc.PrinterName="Adobe PDF".objectValid){
doc.PrinterName = "Adobe PDF";
}
else if (doc.PrinterName="Power PDF".objectValid){
doc.PrinterName = "Power PDF";
}
Obviously none of the code above works, but basically, if Adobe PDF is available, set the printer to that, if not, set the Printer to Power PDF, if not, set the printer to Microsoft Print to PDF, if not, let the user decide.
Copy link to clipboard
Copied
Per the documentation, doc.PrinterName has no effect on Windows - presumably it works on Macintosh (or Linux?).


-
- 1
- 2