Free Support Forum - aspose.com

Water mark position issue


#1

Hello team,

Provide provision to put water mark in center and diagonally at document pages. Like Aspose license version water mark.

In Slides document, we are able to remove water mark from master slide with setting. But your license version water mark still there, please provide this type of provision.


#2

@praveen043,

I have observed your comments and like to share that you I’ll need to call Aspose.Slides product license to avoid the product license watermark in your generated presentation.


#3

Hello Team,

This is not a issue regarding product license watermark. I want to implement such type of text water mark in our document.

Please provide a provision. I am also share the PPT source code for water marking but user is able to remove the water marking by checked the “Hide Background Graphics” option in Master SlideCapture_slide.PNG (23.4 KB)

String extName = fileName.substring(fileName.lastIndexOf("."),
fileName.length());

		com.aspose.slides.Presentation pres = new com.aspose.slides.Presentation(
				inStream);

		com.aspose.slides.IMasterSlide master = pres.getMasters().get_Item(
				0);
		com.aspose.slides.IAutoShape ashp = master.getShapes()
				.addAutoShape(com.aspose.slides.ShapeType.Rectangle, 80,
						50, 700, 500);
		ashp.addTextFrame(watermarkText);

		ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
				.get_Item(0).getPortionFormat().getFillFormat()
				.setFillType(com.aspose.slides.FillType.Solid);
		ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
				.get_Item(0).getPortionFormat().getFillFormat()
				.getSolidFillColor().setColor(Color.GRAY);
		ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
				.get_Item(0).getPortionFormat().setFontHeight(35);

		// Change the line color of the rectangle to White
		ashp.getShapeStyle().getLineColor().setColor(Color.WHITE);
		ashp.getShapeStyle().setLineStyleIndex(
				com.aspose.slides.LineStyle.ThinThin);

		// Remove any fill formatting in the shape
		ashp.getFillFormat().setFillType(com.aspose.slides.FillType.NoFill);

		ashp.setRotation(-31);
	
		ashp.getAutoShapeLock().setAdjustHandlesLocked(true);
		ashp.getAutoShapeLock().setArrowheadsLocked(true);
		ashp.getAutoShapeLock().setAspectRatioLocked(true);
		ashp.getAutoShapeLock().setEditPointsLocked(true);
		ashp.getAutoShapeLock().setGroupingLocked(true);
		ashp.getAutoShapeLock().setPositionLocked(true);
		ashp.getAutoShapeLock().setRotateLocked(true);
		ashp.getAutoShapeLock().setSelectLocked(true);
		ashp.getAutoShapeLock().setShapeTypeLocked(true);
		ashp.getAutoShapeLock().setSizeLocked(true);
		ashp.getAutoShapeLock().setTextLocked(true);
		
		
		if (".ppt".equalsIgnoreCase(extName)) {
			pres.save(path + fileName, com.aspose.slides.SaveFormat.Ppt);
		} else {
			pres.save(path + fileName, com.aspose.slides.SaveFormat.Pptx);
		}

#4

Hello Team,

I am a licensed user of aspose.

We need water marking on xls, xlsx, doc, docx, ppt, pptx, pdf, jpg, jpeg, png all images.

  1. Watermarking should be on front
  2. Watermarking should not be remove at any ways
  3. Document should be editable

Please advice, it needed to go on paid support.


#5

@praveen043,

1) Add watermark in doc and docx - Aspose.Words
See the document on adding watermark to Word document in standard way:
https://docs.aspose.com/display/wordsjava/How+to++Add+a+Watermark+to+a+Document

To bring watermark to front of all content, you can translate/adopt this custom code:
Moving watermark in front of image. Regarding your other requirements, you may create sample file (.doc/docx file) with your desired setting/formatting for watermark in MS Word manually and we can look into it.

2) Add watermark in xls and xlsx - Aspose.Cells
Please see the document on how to add watermark to the worksheet:
https://docs.aspose.com/display/cellsjava/Add+WordArt+Watermark+to+Worksheet
Moreover, you may refer to your other thread on how to add watermarks (using different ways). You can also lock word art shape aspects (so no one could change it):

3) Add watermark to PDF documents - Aspose.PDF
Please see the article(s) for your reference:
https://docs.aspose.com/display/pdfjava/Working+with+Stamps+and+Watermarks

Moreover, we only provide sample code against features in general way. To accomplish your task to support your custom needs, you have to write your own code and logic by yourself for it.

You can avail paid support if you want. You should also share your simplified input and expected documents. You can open a ticket (if you already bought Paid support service) in Paid Support Helpdesk and ask for writing code samples for your expected files.


#6

@praveen043,

I have worked with the sample code and requirements shared by you and have been able to observe the issue specified. An issue with ID SLIDESJAVA-37462 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


#7

Any update regarding the same.


#8

I am not able to login at “https://lutsk.dynabic.com/jira/login.jsp”.
Please provide the credential.


#9

@praveen043,

You are trying to access our private issue tracking system which is not allowed for our valued clients. It is only for Aspose staff. You can observe the issue status by checking the status linked with issue ID at bottom of page.


#10

@praveen043,

We have internally observed the requirements of putting watermark on master slide. Although, it provides benefit by adding watermark only on master level and all other slides inherits that but the limitation is imposed owing to PowerPoint feature of “Hide Background Graphics” that hides all the graphics on master slide. In order to avoid this you can add the watermark on individual slide level rather than master slide level. Aspose.Slides also insert its own watermark in case on unlicensed access on individual slide level. I hope the shared information will be helpful.


#11

Please share the source code in JAVA.


#12

@praveen043,

I suggest you to please try using following sample code on your end.

public static void AddWatermarkOnSlideLevel()
{

    com.aspose.slides.Presentation pres = new com.aspose.slides.Presentation("TestPres.pptx");

    for(ISlide slide:pres.getSlides())
    {
        com.aspose.slides.IAutoShape ashp = slide.getShapes()
                        .addAutoShape(com.aspose.slides.ShapeType.Rectangle,
                                        50, 50, 500, 500);
        ashp.addTextFrame("Watermark Text");

        ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
                        .get_Item(0).getPortionFormat().getFillFormat()
                        .setFillType(com.aspose.slides.FillType.Solid);
        ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
                        .get_Item(0).getPortionFormat().getFillFormat()
                        .getSolidFillColor().setColor(Color.GRAY);
        ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
                        .get_Item(0).getPortionFormat().setFontHeight(25);

        // Change the line color of the rectangle to White
        ashp.getShapeStyle().getLineColor().setColor(Color.WHITE);
        ashp.getShapeStyle().setLineStyleIndex(
                        com.aspose.slides.LineStyle.ThinThin);

        // Remove any fill formatting in the shape
        ashp.getFillFormat().setFillType(
                        com.aspose.slides.FillType.NoFill);

        ashp.setRotation(-45);

        ashp.getAutoShapeLock().setSelectLocked(true);
        ashp.getAutoShapeLock().setSizeLocked(true);
        ashp.getAutoShapeLock().setTextLocked(true);
        ashp.getAutoShapeLock().setPositionLocked(true);
        ashp.getAutoShapeLock().setGroupingLocked(true);
    }
    String   path="C:\\Aspose Data\\"; 
    pres.save(path + "SavedWatermark.pptx", com.aspose.slides.SaveFormat.Pptx);   


}