I want to add runtime Text or Image watermark on pdf using iText1.3 api

Hi all,
I want to add a watermark(text or image) at the runtime, I am creating pdf file with using iText 1.3 api.
It created fine. I have following code for add watermark for an existining file.
<code>
try {
PdfReader reader = new PdfReader("ConfirmBillPDF.pdf");
int n = reader.getNumberOfPages();
PdfStamper stamp = new PdfStamper(reader, new FileOutputStream("NewPDFWithWatermarkImage.pdf"));
int i = 0;
PdfContentByte under;
Image img = Image.getInstance("ValidityExpWaterMark.png");
img.setAbsolutePosition(100, 400);
while (i < n)
i++;
under = stamp.getUnderContent(i);
under.addImage(img);
stamp.close();
catch (Exception de)
de.printStackTrace();
</code>
But I want to add this with runtime.
Plese help me..

MODERATOR ACTION: moved this here from the Servlets forum 'for closer topic alignment'.

Similar Messages

  • How to invoke alt-text for images in a PDF file by Automation

    Hi,
    Can any one help me?
    How to invoke Alt-text for Images in a PDF file using script?
    Thanks for looking into this.
    Regards,
    Sudhakar

    What do you mean "invoke" alt-text?  If Alt-text is there, then it will be presented to a screen reader.

  • Is it possible to add highlighted text in an iBooks interactive textbook using VoiceOver?

    Is it possible to add highlighted text in an iBooks interactive textbook using VoiceOver?

    The only way you can add read aloud to an ibook is by using easy epub code editor. (Go to itunes and look it up). This app works on the ipad and is the ONLY app that can generate smil/xml code for read aloud. The only thing is that you cannot use it on anything but a raw epub file. You cannot use it with ibooks author or with any other file. Hope this helps.

  • To convert multiple image files to pdf using pdfsharp in C#

    Hey guys I have this C# code to convert any image file to .pdf using pdfsharp.dll. But I want to select multiple images for conversion please help. here's my code (plz note enable pdfsharp.dll in the reference)
    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.Linq;
    usingSystem.Text;
    usingSystem.Threading.Tasks;
    usingPdfSharp.Pdf;
    usingPdfSharp.Drawing;
    usingSystem.IO;
    namespaceConsoleApplication1
    classProgram
    staticvoidMain(string[]
    args)
    PdfDocumentdoc =
    newPdfDocument();
    doc.Pages.Add(newPdfPage());
    XGraphicsxgr =
    XGraphics.FromPdfPage(doc.Pages[0]);
    XImageimg =
    XImage.FromFile(source
    path...);
    xgr.DrawImage(img,0,0);
    doc.Save(destination path...);
    doc.Close();

    try this one
    public string CreatePDF(System.Collections.Generic.List<byte[]> images)
    dynamic PDFGeneratePath = Server.MapPath("../images/pdfimages/");
    dynamic FileName = "attachmentpdf-" + DateTime.Now.Ticks + ".pdf";
    if (images.Count >= 1) {
    Document document = new Document(PageSize.LETTER);
    try {
    // Create pdfimages directory in images folder.
    if ((!Directory.Exists(PDFGeneratePath))) {
    Directory.CreateDirectory(PDFGeneratePath);
    // we create a writer that listens to the document
    // and directs a PDF-stream to a file
    PdfWriter.GetInstance(document, new FileStream(PDFGeneratePath + FileName, FileMode.Create));
    // opens up the document
    document.Open();
    // Add metadata to the document. This information is visible when viewing the
    // Set images in table
    PdfPTable imageTable = new PdfPTable(2);
    imageTable.DefaultCell.Border = Rectangle.NO_BORDER;
    imageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
    for (int ImageIndex = 0; ImageIndex <= images.Count - 1; ImageIndex++) {
    if ((images(ImageIndex) != null) && (images(ImageIndex).Length > 0)) {
    iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(SRS.Utility.Utils.ByteArrayToImage(images(ImageIndex)), System.Drawing.Imaging.ImageFormat.Jpeg);
    // Setting image resolution
    if (pic.Height > pic.Width) {
    float percentage = 0f;
    percentage = 400 / pic.Height;
    pic.ScalePercent(percentage * 100);
    } else {
    float percentage = 0f;
    percentage = 240 / pic.Width;
    pic.ScalePercent(percentage * 100);
    pic.Border = iTextSharp.text.Rectangle.BOX;
    pic.BorderColor = iTextSharp.text.BaseColor.BLACK;
    pic.BorderWidth = 3f;
    imageTable.AddCell(pic);
    if (((ImageIndex + 1) % 6 == 0)) {
    document.Add(imageTable);
    document.NewPage();
    imageTable = new PdfPTable(2);
    imageTable.DefaultCell.Border = Rectangle.NO_BORDER;
    imageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
    if ((ImageIndex == (images.Count - 1))) {
    imageTable.AddCell(string.Empty);
    document.Add(imageTable);
    document.NewPage();
    } catch (Exception ex) {
    throw ex;
    } finally {
    // Close the document object
    // Clean up
    document.Close();
    document = null;
    return PDFGeneratePath + FileName;

  • Insert image into a .pdf using InDesign

    Can I insert image into a .pdf using InDesign....

    You can place a PDF as an image in InDesign, then add more content and export a new PDF.
    There are also commercial plugins available that will allow you to open a PDF as editable objects in InDesign.

  • Can we programmatically search, hightlight text and make annotations in PDF using JQuery?

    How can i  programmatically search, hightlight text and make annotations in PDF using JQuery?

    JQuery is part of the OS and Acrobat/Reader is very isolated from the contact with the OS. If you were to write a plug-in in and add it to your copy of Acrobat/Reader you could then use that plug-in to access the OS shell.

  • How to get image properties in PDF using javascript or plug ins

    Hi
    How to get the image(all the images) properties in PDF using javascript or suggest plug ins
    Thanks in Advance

    HI,
    In the PDF Edit API's ( as has already been suggested) there is the PDEImage and using this you should be able to find out everything you need to know about any image in a PDF file.
    I would recommend starting with PDEImageGetAttrs
    Hope this helps
    Malcolm

  • How to get image properties in PDF using javascript

    Hi
    How to get the image(all the images) properties in PDF using javascript?
    Thanks in Advance

    Hi
    Thanks for your quick response. Any recommended plug ins
    Thanks in advance

  • Want to add Custom text after Product Branding Image for application

    Hi
    Can we add any text after Product Branding Image for application
    By default it will show the responsibility function name
    My requirement is after company logo I want to add Text at the top of application
    with center align
    Need suggestions
    Regards
    Krishna

    Hi Anoop
    If I done what u suggested then the function responsibilty name will also come
    and the application will be disturbed
    Is their a way to edit the text at the top
    Regards
    Krishna

  • How do I add alt text to images set as background in my asset list?

    I have designed a site in Muse but for some reason all the images are set as background images in the asset list and I can't optimise them for seo as I can't add alt text.
    How can I change this??
    Thanks

    I know I can't add alt tags to background images hence my question - how do I change them from background images - I was unaware you could assign an image as a background in the first place!
    To my knowledge I haven't intentionally set any of the images as background images.
    I need to change them from background images to 'normal' images.
    Thanks

  • Is there any way to add a text from html into a PDF form using javascript?

    I have a SCORM based package having only a PDF form to show. I want to add user name from SCORM LMS to be added on the PDF whenever user launches PDF from LMS.
    Please let me know if there is any way to execute this.
    Thanx.

    Hi, hbirkie, and welcome to Apple Discussions. No, there isn't any way to apply text to a photo in iPhoto — you have to do that in a different application. MS Word is the last one I would ever have thought of using for that purpose, but if it works for you, great!

  • How do I add LaTeX or an image to a PDF in Preview?

    I would like to be able to annotate a PDF with math formulas. I saw an option for adding latex, but I can't get it to work. I could create the image of the formula that I want to add, but I can't seem to add an image to the PDF either.
    Any suggestions will be appreciated.
    Thanks,
    Nicole

    With Acrobat Professional (perhaps also with Standard)
    From the tools menu
    The TouchUp Object tool can perform copy & paste.

  • Printing a PDF document to virtual PDF printer converts text to image in output PDF-file

    When I "print" any regular PDF document to a PDF virtual printer, it always converts a source regular (textual) PDF document into an image only document. It applies even to pure plain text documents (say, HTML source code etc.)
    (I often need to create a PDF document from the existing PDF. Yes, I know, it might seems quite pointless, but actually it makes sense.)
    Thus I have 2 questions:
    1) Is such sonvertion normal or I do anything wrong myself?
    2) It is by design, is there any woraround to prevent conveting text to image?
    Many thanks in advance!

    Have you checked to see if the "Print As Image" option is inadvertently checked? In the Print dialog, click the Advanced button then look for the checkbox.

  • Change images/content within PDF using controls?

    Hi,
    Sorry about the title of the question -- not sure how to phrase it. Basically I need to know:
    Is it possible, within a PDF, to give the viewer an option to switch content using a dropdown list, or radio buttons or some other form of control.
    So, lets say I have an image on the pdf, and a drop-down next to it. If the user pick 'A' from the drop-down, they get one image, if 'B' another. Similar thing for a piece of text.
    Is this something that can be done (HOW it could be done that would be awesome to know also : ) ?
    A similar side-question:
    Is it possible to allow a user to "upload" an image into a pdf? Something like having a placeholder for an image on the PDF, and an UPLOAD button, that lets the user browse for an image, which will then go into the placeholder (and made to fit). Is this possible?
    Thanks in advance for any info,
    Andrey

    Hey Data_bitz
    Let me see if I understand correctly:
    Content is in Workflow A.
    Exception occurs the content goes to another workflow (or step) assigned to the "exception" alias.
    Now you want the members of the exception alias to figure out where the content should really go and reroute it to that workflow.
    Is that right?
    There are a number of ways to do this but here is one using sub workflows and jumps.
    If so you should do the following
    Workflow A = step 1.. step N, exception step, final step, exit
    In the exception step entry event check for the custom metadata field value. If present, stay in the step, if absent or set to some automatic default, skip the exception step and continue to final step.
    In the exception step update event check for a custom metadata field value that indicates what exception resolution workflow the content should go into.
    Have a jump defined for each exception resolution workflow and a return step that comes back to the final step of Workflow A (that last return step is optional).
    The idea is that your exception managers (members of your exception alias take a look at the content, figure out what workflow is needed, select the workflow from a metadata option list that only appears when the doc is in workflow (you do this with profiles), and effectively "assign" it to the users in that particular exception resolution workflow.
    You really do not want to be changing security groups in the middle of a workflow as it breaks the security paradigm of the document.
    hope this helps!
    Warmly,
    Billy Cripe
    Fishbowl Solutions

  • I want an add-on that opens images in whatever program I choose

    You know how when you're looking at a folder in Windows Explorer, you right click on an image filetype and there's an "open with" option where you can select what program with which to open/view/edit that image?
    Is there an add-on for FireFox that allows me to do the same thing?
    For example, I go to http://icanhascheezburger.com I see an image I like and want to save, but I want to open it in IrfanView to edit it before I save it. So in Firefox, I right click on the image and I get the "open with" menu a if I right clicked ob the same file after saving it

    One add-on that can do that is Launchy - https://addons.mozilla.org/firefox/addon/launchy/
    Though the description states it lets you open links and mailto's with external applications, you can also configure it so that when you right-click on an image you get the option to open the image in your chosen application. For details on setting up Launchy see http://gemal.dk/mozilla/launchy.html

Maybe you are looking for

  • What are Layers? And why do I need them?

    WHAT ARE LAYERS? AND WHY DO I NEED THEM? Layers are an essential part of Photoshop. With Layers you can separate pictures or design elements from each other, as if they are stacked on pieces of glass. With all elements separate, you can move or chang

  • Update Error Code: 0x80070520 fbl_impressive 10041 Professional

    Greetings, I was trying to Update from 9926 to build 10041, Eventlog says: Protokollname: System Quelle:        Microsoft-Windows-WindowsUpdateClient Datum:         19.03.2015 15:20:50 Ereignis-ID:   20 Aufgabenkategorie:Windows Update-Agent Ebene:  

  • Switching from pc to mac and coffeecup to iweb

    My eeepc has been a great little computer but after 2 years of heavy use I'm considering upgrading. The new macbooks looks like they might just fit the bill. I travel a lot and need something small. My first concern is the software I use to design my

  • How can you view flash video on ipad

    Is there an app that you can get that will let you watch flash video on your iPad? Since adobe flash is not supported on iPad

  • Why does iMac 2007 keep going off during power up?

    I've tried starting up several times, including in safe mode.  The bar gets about ¼ way along, then everything shuts off, again. No idea where my original disc is, but the DVD player hadn't worked for a few weeks now either. Not sure what to do.  A s