Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Watermark #14

Closed
tejpratap46 opened this issue Mar 7, 2021 · 1 comment
Closed

Add support for Watermark #14

tejpratap46 opened this issue Mar 7, 2021 · 1 comment
Assignees

Comments

@tejpratap46
Copy link
Owner

Add ability to add watermark on every page of PDF.

@tejpratap46 tejpratap46 self-assigned this Mar 7, 2021
@tejpratap46 tejpratap46 changed the title Add support for adding Watermark Add support for Watermark Mar 9, 2021
@tejpratap46
Copy link
Owner Author

Example Code:

@Nullable
@Override
protected PDFImageView getWatermarkView(int forPage) {
    PDFImageView pdfImageView = new PDFImageView(getApplicationContext());
    FrameLayout.LayoutParams childLayoutParams = new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            200, Gravity.CENTER);
    pdfImageView.setLayout(childLayoutParams);

    pdfImageView.setImageResource(R.drawable.ic_pdf);
    pdfImageView.setImageScale(ImageView.ScaleType.FIT_CENTER);
    pdfImageView.getView().setAlpha(0.3F);

    return pdfImageView;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant