Add UserID to Printed PDF file
I have javascript that prints some text and a date stamp on each page of a pdf file. Now the Management wants this information to include the persons id that is logged onto the computer from which the pdf file was printed.
As documented in Adobe's Acrobat JavaScripting Manual, there are security restrictions with respect to the "identity" object. Those restrictions prevent one from directly accessing the "identity" object from a form field. You can access the properties from a folder level JavaScript. The following script when placed in Acrobat's application JavaScript folder will create and initialize application level variables that be accessed by any PDF opened by Acrobat:
// Folder level script to create an application level variables for the "identity" objects properties
var Identity = new Array();
Identity.Corporation = identity.corporation;
Identity.Email = identity.email;
Identity.LoginName = identity.loginName;
Identity.Name = identity.name;
// or
var Identity = new Array();
for (i in identity)
Identity.i = identity.i;
One can then add the following document level or field level javaScript to initialize fields within the PDF to the value of the application level variables:
this.getField("loginName").value = Identity.LoginName;
this.getField("name").value = Identity.Name;
this.getField("by").value = "By: ";
this.getField("by").value += Identity.Name;
With version 7.0 or above, you can use a trusted function located as a document level script to retrieve the information:
trustedIdentity = app.trustedFunction( function (sProperty) {
var iProperty = "";
app.beginPriv(); // explicitly raise privilege
iProperty = identity[sProperty];
app.endPriv();
return iProperty;
One can then add the following document level or field level javaScript to initialize fields within the PDF to the value of the application level variables:
this.getField("loginName").value = trustedIdentity("loginName");
this.getField("name").value = trustedIdentity("name");
this.getField("by").value = "By: ";
this.getField("by").value += trustedIdentity("name");
Similar Messages
-
How to print pdf file by using java print API ? I am trying with this code
import java.io.FileInputStream;
import java.io.InputStream;
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.PrintException;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.SimpleDoc;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.MediaSizeName;
public class PDFPrint {
static public void print(InputStream inputStream, PrintService printService) throws PrintException {
Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add(MediaSizeName.ISO_A4);
attributes.add(new Copies(1));
print(doc, attributes, printService);
}//print()
static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
if (printService == null) {
printService = PrintServiceLookup.lookupDefaultPrintService();
System.out.println("The Printer Name is :"+printService.getName());
DocPrintJob docPrintJob = printService.createPrintJob();
System.out.println("Before Print Start()");
docPrintJob.print(doc, attributes);
}//print()
public static void main(String args[])
PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
String file="c:/BackUp/file.pdf";
FileInputStream fis=new FileInputStream(file);
System.out.println("Before Print() called ..");
print(fis,defaultPrintService);
System.out.println("After Printing....");
I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
I am using jdk1.4,Acrobat 8.0, Windows environment.
Can u help me in this regard'
Thank u
graniimport java.io.FileInputStream;
import java.io.InputStream;
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.PrintException;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.SimpleDoc;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.MediaSizeName;
public class PDFPrint {
static public void print(InputStream inputStream, PrintService printService) throws PrintException {
Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add(MediaSizeName.ISO_A4);
attributes.add(new Copies(1));
print(doc, attributes, printService);
}//print()
static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
if (printService == null) {
printService = PrintServiceLookup.lookupDefaultPrintService();
System.out.println("The Printer Name is :"+printService.getName());
DocPrintJob docPrintJob = printService.createPrintJob();
System.out.println("Before Print Start()");
docPrintJob.print(doc, attributes);
}//print()
public static void main(String args[])
PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
String file="c:/BackUp/file.pdf";
FileInputStream fis=new FileInputStream(file);
System.out.println("Before Print() called ..");
print(fis,defaultPrintService);
System.out.println("After Printing....");
I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
I am using jdk1.4,Acrobat 8.0, Windows environment.
Can u help me in this regard'
Thank u
grani -
I have an iPad 2 with iOS 5.1 and iBooks version 2.1.1. I have 64GB of storage, 80% is used. iBooks is using 250MB of storage. I have a large number of PDF files in my iBooks library. At this time I can not add another book or PDF file to my library. When I try to move a PDF file to iBooks the system works for a while...sometimes the file appears and than disappears....sometimes the file never appears. Is ther some limit to the number of books or total storage used in IBooks? Thanks....
Hi jybravo70,
Welcome to the Apple Support Communities!
It sounds like you may be experiencing issues on your non iOS 8 devices because iOS 8 is required to set up or join a Family Sharing group.
The following information is located in the print at the bottom of the article.
Apple - iCloud - Family Sharing
Family Sharing requires a personal Apple ID signed in to iCloud and iTunes. Music, movies, TV shows, and books can be downloaded on up to 10 devices per account, five of which can be computers. iOS 8 and OS X Yosemite are required to set up or join a Family Sharing group and are recommended for full functionality. Not all content is eligible for Family Sharing.
Have a great day,
Joe -
HP LaserJet Pro CM1415fnw Color Multifunction Won't Print PDF Files
I recently encountered a problem where my HP LaserJet Pro CM1415fnw Color Multifunction would not print PDF files. I tried printing from Preview, Adobe Reader, Word and PDF Pen Pro and the document would not print. But the printer had no problem printing other formats such as JPG, DOCX etc. from the same computer both before and after.
What happened is that the computer indicated it sent the document to the printer and the printer screen showed "Printing Document" momentarily - but then the the printer screen would return to the Ready screen and the document would not print. There were not indications that the printer was having a problem.
I reinstalled the HP drivers - no change.
Finally I was able to print the document by opening in Photoshop and saving it as a JPG.
I am running OSX 10.9.2. on a MacBook Pro.
This question was solved.
View Solution.Hi 5teve,
Welcome to the HP Forums, I hope you enjoy your experience!
I understand you are unable to print PDF documents.
I will be happy to help you.
Check the driver name. If it shows HP Laserjet CM1415 - Airprint it would be the Apple driver.
Delete it and add the new driver in for just the HP Laserjet CM1415. You might have to click on the drop down to select it from the list.
Here is a screen shot for a example. Different printer showing though.
Please let me know the results.
Thank you for posting on the HP Forums.
Have a great day!
Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
Gemini02
I work on behalf of HP -
Problem with printing pdf file
hello,
lately i have problem with printing pdf file:
i click on the print button and the respod is very slow
it takes more than a minute till the print window apears.
i tryied to install version X but it's the same, the problem exist only when printing via adobe reader,
other programs i'd working much faster.
please advice,
thank youNo, it is not set to overprint. Also, I have to add that the printing results were not consistent. Sometimes it covered and sometimes it did not.
-
How to print PDF files????
Please see FAQ: How to print a PDF file from Adobe Reader Touch.
If you don't see the Print button in the toolbar, please update to the latest version of Adobe Reader Touch.
FAQ: How to update Adobe Reader Touch to the latest version
The latest version (1.2) also includes newly supported features such as Commenting (adding Sticky Notes, Highlight, Strikeout, and Underline), Save/Save As, and Go to Page.
Here's the blog post by Dennis Griffin (Product Manager for Adobe Reader for Tablets and Smartphones).
Adobe Reader Touch for Windows 8 adds Comments and More -
Cannot print pdf files with 9.3.1, cannot remove patch
does anyone know how to fix msi problems ? updater says 9.3.1 is more functional than 9.4 what does that mean? does that mean I need to remove 9.3.1 in order to install 9.4 ? All i want out of this is the ability to control what stays and want goes onto my hard drive and the ability to print PDF files like the product claims. I swear as my life advances I will not buy a product from a company that cannot support me with there standard issues of products . offering a free product that malfunctions is not my idea of building a trusting relationship. What's more disturbing is that I talked with Ganesh this morning on adobe chat and know i cannot even register with that email. Can anyone fix msi problems or is this just a runaround bad business practice of post WTO new world order ? Thanks for letting me vent. Now about the msi problem...
Thanks for the advice, but I'm
already beyond that(go to add remove
programs and click remove). I did my backup and downloaded windows installer cleanup from http://majorgeeks.com/Windows_Installer_CleanUp_Utility_d4459.html After download when I ran the program to install it, the window that popped up was labled "Microsoft Office Update". When that disappeared I found Windows Installer Cleanup located in the All programs list in start. I clicked it and a window popped up about the size of task manager. I scrolled down and highlighted Adobe 9.3.1 and clicked remove and it removed it and the 9.3.1 unremovable update from the conrol panel. Then I went to Adobe.com , downloads and downloaded Adobe 9.4, installed it, and tested it by printing a PDF file. Before I was scared to mess up my netbook and didn't want to deal with the hassle, but we all have our limits until we start to take these kind of risks into the unknown. sometimes, even though it's a burden to register to umpteen forums, it's that extra hassle that gets you over the edge. Please share this info. ohh yeah, NONE of this was done in safe mode. -
Printing PDF files double-sided
Using an HP Photosmart Plus B210a - how do I print PDF files double-sided. I can print Word documents etc. this way but do not seem to have the option when opening a PDF file.
This question was solved.
View Solution.Hi,
You might experiment with a page or two first.
1.Choose File > Print.
2.From the Subset pop-up menu in the Print Range area, select Even Pages Only.
3.Click OK or Print.
4.If the total number of pages is odd, add a blank sheet so the final odd page has a sheet to print on.
5.Put the stack of printed paper back into the supply (source) paper tray so that the unprinted sides print. Point the top of the pages toward the printer. Make sure that the edges of the paper stack are square.
6.Choose File > Print and select Odd Pages Only from the Subset menu.
7.Select the Reverse Pages option. In this scenario, the Reverse pages option ensures that the page sequence is correct.
8.Click OK or Print.
Say Thanks by clicking the Kudos Star in the post that helped you. Please mark the post that solves your problem as Accepted Solution.
I am employed by HP -
Hp officejet 6310 ALl in one printer. WHen printing PDF files, the part or all of the first page prints out in english and the balance is random characters. What is going wrong.
The troubleshooting steps here may help resolve the issue.
Bob Headrick, HP Expert
I am not an employee of HP, I am a volunteer posting here on my own time.
If your problem is solved please click the "Accept as Solution" button ------------V
If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V -
Print PDF file from folder using SSIS
Is there a way in SSIS to print pdf file from folder?
ANy help much appreciated.One method is calling Adobe Acrobat Reader exe from Execute Process Task within SSIS passing the document path as the argument
The command and arguments will look like this
http://geekswithblogs.net/JeremyRamos/archive/2013/10/22/print-ssrs-report--pdf-from-sql-server-agent-or.aspx
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Adobe Acrobat Pro failed to print pdf file
I downloaded adobe acrobat pro and started the 30 trial version just a few minutes ago.
I could open files through adobe acrobat and convert word files to pdf, but when i tried converting a publisher file it could not go through. An error popped up which read "Adobe PDF printer failed to print pdf file".
The publisher file I am hoping to convert to pdf is a 21 page panorama article. It contains lots of images and a variety of font types.
I do not know other alternatives for solving this issue.
Your help will be very much appreciated.
Thank you!
ErikIt seems to be that Adobe Acrobat virtual printer is not properly installed on your PC or you are not selecting Adobe PDF printer to print PDF document. Checkout the below screen shot to see proper printer.
After trying this if you have same problem you may trt some other virtual printer that easily convert or print any file as PDF, you may checkout here. -
Orarrp can't print pdf file directly to printer
oracle remote print utility (orarrp) can't print pdf file directly to printer.
we expect orarrp utility can handle ".rrpa" file (i.e. pdf file generated on the application server) by directly print the file to the client's printer, i.e. invoke the acrobat reader on the client side, display the the printer selection dialogue, after confirmation print the pdf file, then the acrobat reader close automatically nicely.
However we are disappointed as the acrobat reader startup and display the pdf file content but does not print and does not close.
After testing the problem several times, there are some findings:-
Finding (A):-
(a) for the success of direct printing of pdf file, a physical path must be provided; we have tried 2 methods:
1) using drag & drop to copy the pdf file directly to the browser
2) open pdf file in the browser directly using browser menu-->File-->Open.
(b) for the failure of direct printing, a virtual path is involved and we have also tried 2 methods:
1) when web.show_document() is used
2) enter the url to the URL bar of the browser,
eg. http://appsvr.com:7777/report/test_printout/APPSVR1094707.rrpa (this is a virtual path/url)
Finding (B):-
(a)when the physical path is used, a temporary pdf file is generated in the same directory where the rrpa file exists in the application server,
e.g. in application server: d:/printout/yyy.pdf is generated for d:/printout/xxx.rrpa when direct print occurs
(b) however when the virtual path is used, there is no such temp "pdf" file generated and direct print failed.
May be when virtual path is used, orarrp utility don't know where to generate the temp "pdf" so direct print doesn't occur.
So, anyone has similar experience or further queries or has solutions, please join.
Thanks for your attention.Hi,
It is really late to give response this post. But still who ever refering to this post for the same issue this solution is useful for achieving same in background:
Even same can be used in smartforms, for getting spool request in PDF format as well which will decrease the size of file when printing in SAP printer.
ct_tline is PDF output:
DATA: lv_pdfsource TYPE xstring.
FIELD-SYMBOLS:<p> TYPE x. " <p> type any.
LOOP AT ct_tline INTO cs_tline.
ASSIGN cs_tline TO <p> CASTING TYPE x.
CONCATENATE lv_pdfsource <p> INTO lv_pdfsource IN BYTE MODE.
ENDLOOP.
* ->Create spool request in PDF format
CALL FUNCTION 'ADS_CREATE_PDF_SPOOLJOB'
EXPORTING
printer = 'LOCL' "Printer name supporting PDF device type
* DEST =
pages = 1
pdf_data = lv_pdfsource "XSTRING internal table
* NAME =
* SUFFIX1 =
* SUFFIX2 =
* COPIES =
* PRIO =
IMMEDIATE_PRINT = 'X'
* AUTO_DELETE =
* TITLELINE =
* RECEIVER =
* DIVISION =
* AUTHORITY =
* LIFETIME = '0'
* IMPORTING
* SPOOLID =
* EXCEPTIONS
* NO_DATA = 1
* NOT_PDF = 2
* WRONG_DEVTYPE = 3
* OPERATION_FAILED = 4
* CANNOT_WRITE_FILE = 5
* DEVICE_MISSING = 6
* NO_SUCH_DEVICE = 7
* OTHERS = 8
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF. -
How to directly print PDF file(which is stored in SAP) in ABAP report?
Hi experts,
I searched SDN for printing PDF file but everything is about OTF to PDF and to use fm: CONVERT_OTF which is not the solution for my problem.
I have to build ABAP report which will take the PDF file attached to SAP document (CV02N) and print it.So, which function module or program can I use to print the PDF file?
Thank you very much.
Kind regards,
DanijelaDear
this is the code for down load smartform for PDF format. its working properly
2nd way is
set your Acrobat Printer as your default printer
when you print select printer as LOCAL
then you will file dialog box for Naming PDF
DATA : T_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE.
DATA : WA_CTRLOP TYPE SSFCTRLOP.
DATA : WA_OUTOPT TYPE SSFCOMPOP.
DATA : T_OTFDATA TYPE SSFCRESCL.
DATA : T_PDF_TAB LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA : V_FILESIZE TYPE I.
DATA : W_BIN_SIZE TYPE I.
WA_CTRLOP-GETOTF = 'X'.
WA_CTRLOP-NO_DIALOG = 'X'.
WA_OUTOPT-TDNOPREV = 'X'.
CALL FUNCTION P_LV_FNAME
EXPORTING
OUTPUT_OPTIONS = WA_OUTOPT
USER_SETTINGS = 'X'
CONTROL_PARAMETERS = WA_CTRLOP
IMPORTING
JOB_OUTPUT_INFO = T_OTFDATA
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
T_OTF[] = T_OTFDATA-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = W_BIN_SIZE
TABLES
OTF = T_OTF
LINES = T_PDF_TAB
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
DATA : LV_DOWN_FILE TYPE RLGRAP-FILENAME.
DATA : LV_TEXT TYPE STRING.
CASE SSCRFIELDS-UCOMM.
WHEN 'REPRUNMOLD'.
CONCATENATE '(' SO_SCHDT-LOW '-' SO_PLANT-LOW ')' INTO LV_TEXT.
CONCATENATE '\\lkdb01\FTP-Loadstar\0.PP_Planning\ZPP014\Run_Moulds\' SY-DATUM '-' SY-TIMLO '-' 'Running Mould' '-' LV_TEXT '.pdf' INTO LV_DOWN_FILE SEPARATED BY SPACE.
WHEN 'REPLINESIT'.
CONCATENATE '(' SO_SCHDT-LOW '-' SO_PLANT-LOW '-' SO_LINE2-LOW ')' INTO LV_TEXT.
CONCATENATE '\\lkdb01\FTP-Loadstar\0.PP_Planning\ZPP014\Line_Situation\' SY-DATUM '-' SY-TIMLO '-' 'Line Situation' '-' LV_TEXT '.pdf' INTO LV_DOWN_FILE SEPARATED BY SPACE.
ENDCASE.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_BIN_SIZE
FILENAME = LV_DOWN_FILE
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = V_FILESIZE
TABLES
DATA_TAB = T_PDF_TAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE 'File not downloaded succesfully' TYPE 'I'.
EXIT.
ELSE.
MESSAGE 'PDF File downloaded succesfully' TYPE 'I'.
ENDIF.
ENDFORM. " Print_PDF
Rewards if useful. -
How to print PDF file from java application?
Hi,
I have a java application that needs to print an PDF files. Could any one provide me links to tutorial/sample codes for doing this?http://onesearch.sun.com/search/onesearch/index.jsp?qt=print+pdf+files&subCat=&site=dev&qp=&chooseCat=javaall&col=developer-forums
-
How to print pdf file to my Designjet 500+HPGL2 (C7769B)
Hi,
We have HP Designjet 500+GL2 plotter in the office, used to print A1 & A3 drawings. Last time someone from HP install HP eprint & share to my computer for me to print PDF files to the plotter. But my CPU brokedown, so now I'm using a new PC. But now I can't print PDF files to our plotter. Even when I install the eprint & share software from you website.
I already check the possibility that I'm not connected to the printer but no because when I print test page, it is working. Please help. Thanks.Hello lean1025,
Welcome to the HP Support Forums!
To get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial product. You can do this at Printers - Designjet & Large Format.
The support page for your product may be helpful in the meantime: Product Support & Troubleshooting (Select your model)
I hope this helps!
JERENDS
I work on behalf of HP
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!
Maybe you are looking for
-
Windows 7 (Client) map a network drive VPN Snow Leopard Server
Hi, I have a Mac Mini Snow Leopard Server and are using a VPN service. My services on the mac os x sls server are: AFP, DNS, Firewall, Open Directory, SMB and VPN. I can connect the VPN from Mac clients and Windows 7 clients, but I can only map a net
-
Video Player Component using Flash Player 6
I'm streaming video using Flash Player 6. The problem I am having is that the video will only play at a super small size, something like 180 x 60 (that's a guess). Is there a way to play the video at the 320 width that I redered it as? I'm using Flas
-
What updates is Adobe Application Manager trying to install
I'm getting the same behavior that CLS_SP reports (the zoom animation for application startup blinks onto the screen for half a second and then disappears). I am running 10.7.4, on a 16 GB MacBook Pro. I get the same results when I manually open /App
-
Finder window resizing lower left corner is off the screen - Help!
Moving from a 17" PowerBook to the 13" MBA, my Finder windows are too big. If I could only change my default window size from the 17" to the 13" I could Command-A Command-C Command-V the contents of my larger old windows to the smaller new screen...o
-
hi,all: Please give me some advise. Thank you!