Могу ли я программно сохранить часть веб-страницы как изображение?

Если возможно, я хотел бы сделать это простой кнопкой. Пользователи не очень довольны компьютерами, поэтому я просто не сказал им распечатать экран или использовать ножницы.

Я знаю , что это можно сделать в браузерах на основе Mozilla с помощью и drawWindow () . Но это приложение работает в Internet Explorer 7 и 8.

На странице показаны некоторые графики (созданные элементом управления ReportViewer), основанные на вводе пары раскрывающихся списков. Означает ли это, что сценарий на стороне клиента - единственный вариант? Или я мог бы как-нибудь сделать это в серверной части ASP.NET? Возможно, при изменении раскрывающегося списка изображение будет повторно генерироваться заново?
Означает ли это, что сценарий на стороне клиента - единственный вариант? Или я мог бы как-нибудь сделать это в серверной части ASP.NET? Возможно, при изменении раскрывающегося списка изображение будет повторно генерироваться заново?
Означает ли это, что сценарий на стороне клиента - единственный вариант? Или я мог бы как-нибудь сделать это в серверной части ASP.NET? Возможно, при изменении раскрывающегося списка изображение будет повторно генерироваться заново?
UserInfo = 0x2916a0 {NSLocalizedDescription = Невозможно подключиться к iTunes Store} .t

Я могу получить идентификаторы продуктов, которые я зарегистрировал через iTunes Connect. Я показываю данные, связанные с этими продуктами, в виде таблицы вместе с опцией Покупка. Когда я пытаюсь купить продукт, инициируется транзакция, но она не запрашивает у меня никаких данных о тестовом пользователе, и я получаю сообщение об ошибке, как упомянуто выше.

Я предоставляю код, который я реализовал.

    //the below code is for RETREIVING THE PRODUCT id's

#pragma mark Store kit
-(IBAction)sendProductInfoRequest{
NSLog(@"sendProductInfoRequest");

NSSet *identifiersSet=[NSSet setWithObjects:[NSString stringWithFormat:@"%@",@".15April2011"],[NSString                          stringWithFormat:@"%@",@"15April201102"],nil];
SKProductsRequest *productRequest=[[SKProductsRequest alloc] initWithProductIdentifiers:identifiersSet];
productRequest.delegate=self;
[productRequest start];
NSLog(@"completing sendProductInfoRequest");
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSLog(@"yoooo!");
NSLog(@"The product request didReceiveResponse :%@",[response description]);
NSLog(@"The products are :%@",[response.products description]);

NSLog(@"The invalidProductIdentifiers are:%@",[response.invalidProductIdentifiers description]);

NSArray *products=response.products;



for(SKProduct *currentProduct in products){

NSLog(@"THE Product price is :%@",currentProduct.price);
NSLog(@"THE Product description is :%@",currentProduct.localizedDescription);
NSLog(@"THE Product title is :%@",currentProduct.localizedTitle);
NSLog(@"THE Product's product identifier is :%@",currentProduct.productIdentifier);

}

}



/the BuyProducts method is called when user clicks buy button related to a particular product
-(IBAction)BuyProducts
{
if ([SKPaymentQueue canMakePayments])
{
[self makePaymentRequestForThisProduct:isbnText.text];
}

}



-(void)makePaymentRequestForThisProduct:(NSString*)productID

{
SKPayment *payment = [SKPayment paymentWithProductIdentifier:productID];  
[[SKPaymentQueue defaultQueue] addPayment:payment];
}



/I have added the transaction observer in applicationDidFinishLaunching method of AppDelegate
//Transaction Observer is a class

TransactionObserver *observer;
observer = [[TransactionObserver alloc] init];
[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];

//the TransactionObserver.m class

@implementation TransactionObserver


- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {

switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
NSLog(@"failed transaction");
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
            default:
                break;
        }
    }
}

- (void) completeTransaction: (SKPaymentTransaction *)transaction
{
NSLog(@"successful purchase");
  //  [self recordTransaction: transaction];
//[self provideContent: transaction.payment.productIdentifier];
    [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}

- (void) restoreTransaction: (SKPaymentTransaction *)transaction
{
NSLog(@"restored incomplete transaction");
//   [self recordTransaction: transaction];
//   [self provideContent: transaction.originalTransaction.payment.productIdentifier];
    [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}

- (void) failedTransaction: (SKPaymentTransaction *)transaction
{

NSLog(@"The error description is:%@",[transaction.error description]);
if (transaction.error.code != SKErrorPaymentCancelled)
    {
if(transaction.error.code == SKErrorUnknown) {
NSLog(@"Unknown Error (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
  delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];

[failureAlert show];
[failureAlert release];
}

if(transaction.error.code == SKErrorClientInvalid) {
NSLog(@"Client invalid (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
  delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}

if(transaction.error.code == SKErrorPaymentInvalid) {
NSLog(@"Payment invalid (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
  delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}

if(transaction.error.code == SKErrorPaymentNotAllowed) {
NSLog(@"Payment not allowed (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
  delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}
    }
    [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}


@end

7
задан Pranav Jaiswal 16 October 2012 в 20:36
поделиться