Hi,
I have to implement ASPOSE.Pdf in classic ASP pages.
I done this by using following code:
-
set objForm = Server.CreateObject(“Aspose.Pdf.Facades.Form”)
-
set objGenPDF = Server.CreateObject(“Aspose.Pdf.Facades.Form”)
-
set outputPDF = Server.CreateObject(“Aspose.Pdf.Document”)
-
objForm.BindPdf(“MyFile.pdf”)
-
isFilled = objForm.FillField(fieldName,fieldValue)
-
objForm.Save(“GenFile.pdf”)
-
objGenPDF.BindPdf(GenFile.pdf")
-
outputPDF.Pages.Add_3(objGenPDF.Document.Pages)
-
outputPDF.Save_2(“FinalOutPutFile.Pdf”)
Using line 7 and 8 i added all my generated PDf files in a single file FinalOutPutFile.pdf. It is working fine in my code.
Now the problem is how i can add image(MyImage.jpg) on my PDF’s each page. Also I have lower left x and y coordinates and width and height to resize image when needed.
Please let me know the way to do this…
@spallavi1
Thank you for contacting support.
We would like to share with you that you can add image stamp on each page of a PDF document by using below code snippet.
// Open document
Document pdfDocument = new Document(dataDir+ "AddImageStamp.pdf");
foreach (Page page in pdfDocument.Pages)
{
// Create image stamp
ImageStamp imageStamp = new ImageStamp(dataDir + "aspose-logo.jpg");
imageStamp.Background = true;
imageStamp.XIndent = 100;
imageStamp.YIndent = 100;
imageStamp.Height = 300;
imageStamp.Width = 300;
imageStamp.Rotate = Rotation.on270;
imageStamp.Opacity = 0.5;
// Add stamp to each page
page.AddStamp(imageStamp);
}
dataDir = dataDir + "AddImageStamp_out.pdf";
// Save output document
pdfDocument.Save(dataDir);
You may visit Adding Image Stamp in PDF File for more details about image stamp. We hope this will be helpful. Please feel free to contact us if you need any further assistance.