CopyCode The Code is as follows: using system;
Using system. Collections. Generic;
Using system. text;
Using system. drawing;
Using system. IO;
Using system. Drawing. imaging;
Using system. Web;
Using system. Drawing. drawing2d;
Using system. reflection;
Namespace Chen
{
Public class warterpic
{
/// /// Add a watermark to the image
/// /// /// ///
Public void markwater (string filepath, string waterfile)
{
I have been working on adding watermarks to PDF documents for a long time. Make a record as follows:
The itextsharp component will be used first. You can download it from the official website, and I will add it in this article.
Add reference to the Code as follows:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using iTextSharp.
Let's look at the effect chart first:
The main code is as follows:
Package sea;
Import Net.coobird.thumbnailator.Thumbnails;
Import net.coobird.thumbnailator.geometry.Positions;
Import Javax.imageio.ImageIO;
Import Java.awt.image.BufferedImage;
Import Java.io.File;
Import java.io.IOException;
Import java.util.ArrayList;
Import java.util.List; /** * User:Greta.Wang * date:12-11-3 * Read Nine pictures from file system, and compose them to one, in the process,
Each of the picture would be add
This article mainly introduces the ASP.net how to add watermark text to the picture to achieve, the need for friends can refer to the The first step is to add a generic handler (Handler), in this case ImageHandler nbsp; code as follows: using System; Using System.Data; Using System.Configuration; Using System.Web; Using System.Web.Security; Using System.Web.UI;
This article mainly introduces the PHP use of the GD library for the page to add watermark to the specific implementation, the need for friends can refer to the following nbsp; Code as follows: ;nbsp; nbsp;
The AspJpeg component implements the calling method of adding a watermark function :
The following is a reference fragment:function Printwater (Waterpath,upfilepath)Dim Logobox,logopath,ogvboxLogopath = Server.MapPath (Waterpath)Set Logobox = Server.CreateObject ("Persits.jpeg")Logobox.open LogopathLogobox.width = 108Logobox.height = 65Set Ogvbox = Server.CreateObject ("Persits.jpeg")Ogvbox. Open Trim (Server.MapPath (Upfilepath))Ogvbox
' Specify the picture you want to add the watermark text toDim img as Image = Image.FromFile (Server.MapPath ("~/upload/1.jpg"))' Create a Bitmap object for the drawing operation (you cannot directly manipulate a format other than BMP, possibly)Dim Bitmap as New bitmap (343, 498)' The font to draw the textDim F as New Font ("Microsoft Ya-Black", fontstyle.underline)' Text contentDim str as String = Textbox5
The project is changing, the demand is changing, the invariable is always the programmer tapping the keyboard ...
After the PDF is generated, it is sometimes necessary to add some other content to the PDF, such as text, pictures ....
After several failed attempts, I finally got the right way to write code.
Summary of this record to facilitate the next status q
I. Problem description:
After some PDF files are opened, you cannot add comments, notes, bookmarks, etc. A line of text in the toolbar is "you are viewing this document in PDF/A mode ". PDF/A is a type of PDF format,
It is designed to save files for a long time. Basically,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.