add stamp annotation using PSPDFKit iOS objective-c - ios

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.

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.

Related

adding GPUImage framework to IOS project

The hours are turning into days trying to add the GPUImage framework into an IOS project. Now I've got it working I'm trying the sample filtering live video code from Sunset Lake Software page. The app fails to build with the following red error: ' Use of undeclared 'thresholdfFilter'
GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
GPUImageFilter *customFilter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:#"CustomShader"];
GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 768, 1024)];
// problem here
[videoCamera addTarget:thresholdFilter];
[customFilter addTarget:filteredVideoView];
[videoCamera startCameraCapture];
Using Xcode 6.0.1 and testing app on iPad2 with IOS 8.0.2 - If required, I can post screen shots of how I emdedded the framework.
First, the code written in my initial blog post announcing the framework should not be copied to use with the modern version of the framework. That initial post was written over two years ago, and does not reflect the current state of the API. In fact, I've just deleted all of that code from the original post and directed folks to the instructions on the GitHub page which are kept up to date. Thanks for the reminder.
Second, the problem you're describing above is that you're attempting to use a variable called thresholdFilter without ever defining such a variable. That's not a problem with the framework, the compiler has no idea what you're referring to.
Third, the above code won't work for another reason: you're not holding on to your camera instance. You're defining it locally, instead of assigning it to an instance variable of your encapsulating class. This will lead to ARC deallocating that camera as soon as your above setup method is complete, leading to a black screen or to a crash. You need to create an instance variable or property and assign your camera to that, so that a strong reference is made to it.

OData4ObjC without using proxyclasses

I am using OData4ObjC, want to know is there a way to add/update/delete an entry in a table without using proxy classes. Just similar way the OData4j for Android does
e.g.,
OEntity havinaCola = c.getEntity("Products", 3).execute();
I am currently using proxy classes for the same as mentioned below,
proxy = [[serviceEntities alloc] initWithUri:#"sampleservices/producer.svc/" credential:nil];
QueryOperationResponse *response = [proxy execute:#"customers"];
NSMutableArray *array = [response getResult];
Thanks.
I have found one way to do the same i.e., as mentioned in the book written by Author 'Matthew Baxter-Reynolds' 'Multimobile Development (Building applications for the iPhone and Android Platform)' suggests method how to GET/UPDATE/DELETE/ADD entries.
Hope this is useful.
Thanks

MECL Paypal convert to ARC (IOS)

I am currently trying to integrate Paypal's MECL in an already existing IOS project using ARC.
I believe that by manually removing all the release / retain in the code should make it ARC compatible.
There is only one statement I do not know how to convert: "InitAndDealloc" that can be find in several class such as here:
static NSString *SolutionTypeStrings[] = {#"Sole", #"Mark"};
static NSString *LandingPageTypeStrings[] = {#"LandingPage", #"Billing", #"Login"};
static NSString *ChannelTypeStrings[] = {#"Merchant", #"eBayItem"};
#define LOCALE_CODE #"LocaleCode"
#implementation SetExpressCheckoutRequestDetails
InitAndDealloc
StringAccessor(ReturnURL)
StringAccessor(CancelURL)
StringAccessor1(cppHeaderImage, #"cpp-header-image")
StringAccessor1(cppHeaderBorderColor, #"cpp-header-border-color")
StringAccessor1(cppHeaderBackColor, #"cpp-header-back-color")
StringAccessor1(cppPayflowColor, #"cpp-payflow-color")
IntAccessor(AllowNote)
IntAccessor(ReqConfirmShipping)
TypedefAccessor(NoShipping, NoShippingType)
StringAccessor(Token)
AmountAccessor(MaxAmount)
StringAccessor(CallbackURL)
IntAccessor(CallbackTimeout)
GenericAccessor1(FlatRateShippingOptions, ShippingOptions)
IntAccessor(AddressOverride)
StringAccessor(PageStyle)
StringAccessor(BuyerEmail)
StringAccessor(giropaySuccessURL)
StringAccessor(giropayCancelURL)
StringAccessor(BanktxnPendingURL)
GenericAccessor(EnhancedCheckoutData)
GenericAccessor(BuyerDetails)
StringAccessor(BrandName)
GenericAccessor(FundingSourceDetails)
StringAccessor(CustomerServiceNumber)
IntAccessor(GiftMessageEnable)
IntAccessor(GiftReceiptEnable)
IntAccessor(GiftWrapEnable)
StringAccessor(GiftWrapName)
AmountAccessor(GiftWrapAmount)
IntAccessor(BuyerEmailOptinEnable)
StringAccessor(SurveyQuestion)
StringAccessor(CallbackVersion)
IntAccessor(SurveyEnable)
MutableArrayAccessor(PaymentDetails)
MutableArrayAccessor(BillingAgreementDetails)
MutableArrayAccessor1(OtherPaymentMethods, OtherPaymentMethodDetails)
MutableArrayAccessor1(SurveyChoice, NSString)
EnumAccessor(SolutionType, SolutionType)
EnumAccessor(LandingPage, LandingPageType);
EnumAccessor(ChannelType, ChannelType);
If I remove the line "InitAndDealloc", it seems as if I cannot set the variables anymore in the class. Indeed, I have also the working (Non ARC) paypal demo.
By doing this:
SetExpressCheckoutRequestDetails *sreq = [[SetExpressCheckoutRequestDetails alloc] init];
sreq.ReturnURL = #"Bob";
NSLog(#"%# ", sreq.ReturnURL );
In both projects.
Mine will return null, paypal's will return the Bob.
Has it even got anything to do with "InitAndDealloc" or am I looking at it wrong? If it is how do I replace "InitAndDealloc" in an ARC project? I can't seem to find a simple "Init" with autocompletion and by googling "InitAndDealloc" I get absolutely no results whatsoever :/
Thanks for reading!
I've never used MECL before but the way it's being called "InitAndDealloc" certainly is not Objective C and therefore wouldn't be subject to the same rules that ARC requires for Objective C. Best to leave it in place and not try to futz or struggle with it.
But anyways, instead of struggling with trying to ARC-enable some published & potentially-problematic SDK code, why not turn ARC off for the MECL files?
Here is a related question that describes how to turn ARC off for individual files.

LevelHelper and Corona SDK

Why do I get a black screen when I generate Lua code from the newest version (1.4.7) of LevelHelper My Old Level files work with my code and it generated only one lua file. The new one generates a set of 10-12 files, and leaves me with a black screen on the Corona simulator.
Am I doing anything drastically wrong?
Has the use of Level Helper changed with the new version?
All the tutorials and blogs I checked are showing the use of the old LevelHelper. any repositories / github links you would like to point me to?
For everybody else who has this problem, your config.lua file must look something like this
application =
{
content =
{
fps = 60,
width = 320,
height = 480,
scale = "letterbox",
imageSuffix =
{
["-hd"] = 2
}
},
LevelHelperSettings =
{
imagesSubfolder = "Images",
levelsSubfolder = "Levels",
directorGroup = nil
}
}
Have you seen this?
http://www.levelhelper.org/?page_id=1596
And also the latest tutorial for Corona SDK that talk LevelHelper 1.4
http://www.levelhelper.org/?p=1821
While the old LevelHelper was generating only one lua file - the new one generated multiple files because it added many complex features that could not be encapsulated in only one lua file.
Also, i want to stress that if you want fast response you should mail me or write to the LevelHelper forum.
I can help you out with your code and what you're doing wrong if you show me how you load the level.
Since you probably load it as the old way you should read the Getting Started chapter in the API Documentation.
You are probably missing the config.lua settings.

iOS Barcode Efficient Scanner

I am working on an iOS application and I am interested to embed some already developed and tested barcode scanner into it. I tried zxing but this never extract the numbers out of it. My goal is to scan this image and get 24 characters out of it.
If there is not a already developed thing, I would like to build one myself. How should I start in order to create it from scratch for 1D barcodes initially?
Using zxing I am using this piece of code now.
- (IBAction)scanPressed:(id)sender {
ZXingWidgetController *widController = [[ZXingWidgetController alloc] initWithDelegate:self showCancel:YES OneDMode:YES];
zxing::oned::Code128Reader *code128Reader = new zxing::oned::Code128Reader();
MultiFormatOneDReader *mfReader = [[MultiFormatOneDReader alloc] initWithReader:code128Reader];
NSSet *readers = [[NSSet alloc ] initWithObjects:mfReader,nil];
[mfReader release];
widController.readers = readers;
[readers release];
NSBundle *mainBundle = [NSBundle mainBundle];
widController.soundToPlay =
[NSURL fileURLWithPath:[mainBundle pathForResource:#"beep-beep" ofType:#"aiff"] isDirectory:NO];
[self presentModalViewController:widController animated:YES];
[widController release];
}
I tried ZXing SDK first but it didn't work. I then tried ZBar SDK which worked just amazingly great.
If in future someone would need the same thing I am going to post the link which helped me make it work.
http://zbar.sourceforge.net/iphone/sdkdoc/tutorial.html
If this is a "Code 128" barcode, pay attention of the variant of the code.
For example if using zxing you successfully scanned the code but the decoded values do not match the numbers under the barcode, that's probably because zxing decoded the barcode bytes successfully but didn't render the result using the expected alphabet.
Code 128 exists in three variants:
Code 128 A which uses the alphabet "!#$%&'()*+.-/0123456789:;<=>?# ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
Code 128 A which uses the wider alphabet "!#$%&'()*+.-/0123456789:;<=>?# ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`` abcdefghijklmnopqrstuvwxyz{|}~
Code 128 C which encodes numbers 0-9
Maybe zxing returns the 128-A or 128-B interpretation of the barcode and not the 128-C variant? In such cases it would mean that the scanning works correctly but you may force the barcode format so it can interpret it right.
Maybe I'm wrong about this the zxing code bases for iphone only allows for QR codes.
From the website site http://code.google.com/p/zxing/
There are also additional modules which are contributed and/or
intermittently maintained:
zxing.appspot.com: The source behind our web-based barcode generator
csharp: Partial C# port
cpp: Partial C++ port
**iphone: iPhone client + port to Objective C / C++ (QR code only)**
jruby: Ruby wrapper
actionscript: partial port to Actionscript

Resources