0

I am using PSPDFKit framework, and I am unable to add stamp annotation, using this I have implemented following:

[pdfController.annotationStateManager toggleState:PSPDFAnnotationStringStamp];

NSMutableArray<PSPDFStampAnnotation *> *defaultStamps = [NSMutableArray array];
for (NSString *stampSubject in @[@"Great!", @"Stamp", @"Like"]) {
    PSPDFStampAnnotation *stamp = [[PSPDFStampAnnotation alloc] initWithSubject:stampSubject];
    stamp.boundingBox = CGRectMake(0.f, 0.f, 200.f, 70.f);
    [defaultStamps addObject:stamp];
}
PSPDFStampAnnotation *imageStamp = [[PSPDFStampAnnotation alloc] init];
imageStamp.image = [UIImage imageNamed:@"abc.jpg"];
imageStamp.boundingBox = CGRectMake(0.f, 0.f, imageStamp.image.size.width/4.f, imageStamp.image.size.height/4.f);
[defaultStamps addObject:imageStamp];
[PSPDFStampViewController setDefaultStampAnnotations:defaultStamps];

but I have no output.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Zღk
  • 854
  • 7
  • 25

1 Answers1

0

Peter here, Founder and CEO of PSPDFKit, the PDF SDK for iOS, Android, Web, macOS and (soon) Windows. The best way to reach our support is reaching out directly to our support page. Support is part of your license subscription.

You're setting default stamps for the PSPDFStampViewController. Can you post a screenshot how things look? You're changing the default here (APPROVED, REJECTED and so on and replacing this with your own images, which is valid and works.)

Note that you only need to call this once and it needs to be called before you switch/toggle the stamp mode, so your current code will not work.

Please also make sure you use the latest version so we can rule out any old bugs or incompatibilities. As of writing this, it's Xcode 8.3 and PSPDFKit 6.6 (click for release blog post).

Stamps only show up if you have the annotation component licensed - if you ping us on support my team can check what components you have to make sure that's not the problem here.

If you're just trying to programmatically add annotations via our framework, check out this guide article instead.

steipete
  • 7,581
  • 5
  • 47
  • 81