Last active
March 2, 2018 20:04
-
-
Save aspose-pdf/316a7b68434c0790210c455da62eb029 to your computer and use it in GitHub Desktop.
This gist contains Perl code snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aspose.Pdf-for-Cloud-Perl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all annotations from a PDF page | |
$response = $pdfApi->GetPageAnnotations(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
# Display the annotation info | |
foreach my $annotatonLink (@{$response->{'Annotations'}->{'Links'}}){ | |
print "\n Annotation Link :: " . $annotatonLink->{'Href'}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all annotations from a PDF page | |
$response = $pdfApi->GetPageAnnotations(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Annotation Count :: " . scalar(@{$response->{'Annotations'}->{'Links'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
my $pageNumber = 1; | |
my $annotationNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to extract a particular image from a PDF page | |
$response = $pdfApi->GetPageAnnotation(name=>$name, pageNumber=>$pageNumber, annotationNumber=>$annotationNumber); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Annotation Content :: ". $response->{'Annotation'}->{'Contents'}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $fileName = 'SampleAttachment'; | |
my $name = $fileName . '.pdf'; | |
my $attachmentIndex = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to download a specific attachment from a PDF | |
$response = $pdfApi->GetDownloadDocumentAttachmentByIndex(name=>$name, attachmentIndex=>$attachmentIndex); | |
if($response->{'Status'} eq 'OK'){ | |
#download attachment from response | |
my $output_file = $out_path. $fileName . $attachmentIndex . '.text'; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleAttachment.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all attachments from a PDF | |
$response = $pdfApi->GetDocumentAttachments(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
my $attachments = $response->{'Attachments'}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleAttachment.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all attachments from a PDF | |
$response = $pdfApi->GetDocumentAttachments(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Attachment Count :: " . scalar(@{$response->{'Attachments'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleAttachment.pdf'; | |
my $attachmentIndex = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get a specific attachment from a PDF | |
$response = $pdfApi->GetDocumentAttachmentByIndex(name=>$name, attachmentIndex=>$attachmentIndex); | |
if($response->{'Status'} eq 'OK'){ | |
my $attach = $response->{'Attachment'}; | |
print("\n Name :: " . $attach->{'Name'}); | |
print("\n MimeType :: " . $attach->{'MimeType'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all bookmarks from a PDF | |
$response = $pdfApi->GetDocumentBookmarks(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $bookmark (@{$response->{'Bookmarks'}->{'List'}}){ | |
print "\n Boorkmark Href :: " . $bookmark->{'Links'}[0]->{'Href'}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all bookmarks from a PDF | |
$response = $pdfApi->GetDocumentBookmarks(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Boorkmark Count :: " . scalar(@{$response->{'Bookmarks'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $bookmarkPath = '1'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.PDF Cloud SDK API to get bookmarks children | |
$response = $pdfApi->GetDocumentBookmarksChildren(name=>$name, bookmarkPath=>$bookmarkPath); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $bookmarkPath = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get a specific bookmark from a PDF | |
$response = $pdfApi->GetDocumentBookmarksChildren(name=>$name, bookmarkPath=>$bookmarkPath); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Title :: ". $response->{'Bookmark'}->{'Title'}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::AppendDocument; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample.pdf'; | |
my $startPage = 2; | |
my $endPage = 3; | |
my $appendFileName = 'sample-input.pdf'; | |
my @appendDocumentBody = AsposePdfCloud::Object::AppendDocument->new('Document' => $appendFileName, 'StartPage'=>$startPage, 'EndPage'=>$endPage ); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
$response = $storageApi->PutCreate(Path => $appendFileName, file => $data_path.$appendFileName); | |
# Invoke Aspose.Pdf Cloud SDK API to append multiple PDF files | |
$response = $pdfApi->PostAppendDocument(name=>$name, appendFileName=>$appendFileName, body=>@appendDocumentBody); | |
if($response->{'Status'} eq 'OK'){ | |
#download appended document from storage server | |
my $output_file = $out_path. 'appended-' . $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $filename = 'Sample'; | |
my $name = $filename . '.pdf'; | |
my $format = "tiff"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to convert PDF to TIFF | |
$response = $pdfApi->GetDocumentWithFormat(name=>$name, format=> $format); | |
if($response->{'Status'} eq 'OK'){ | |
# Save converted format file from response | |
my $output_file = $out_path. $filename . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $filename = '123'; | |
my $name = $filename . '.pdf'; | |
my $format = "tiff"; | |
my $url = "https://github.com/farooqsheikhpk/Aspose_Pdf_Cloud/raw/master/SDKs/Aspose.Pdf_Cloud_SDK_for_Java/src/test/resources/" . $name; | |
# Invoke Aspose.Pdf Cloud SDK API to convert PDF to TIFF using remote hosted pdf | |
my $response = $pdfApi->PutConvertDocument(url=>$url, format=> $format); | |
if($response->{'Status'} eq 'OK'){ | |
# Save converted format file from response | |
my $output_file = $out_path. $filename . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $filename = 'Sample'; | |
my $name = $filename . '.pdf'; | |
my $format = "tiff"; | |
# Invoke Aspose.Pdf Cloud SDK API to convert PDF to TIFF without cloud storage | |
my $response = $pdfApi->PutConvertDocument(format=>$format, file=> $data_path.$name); | |
if($response->{'Status'} eq 'OK'){ | |
# Save converted format file from response | |
my $output_file = $out_path. $filename . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use File::Slurp; # From CPAN | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample_Test_Book_'; | |
for (0..7) { $name .= chr( int(rand(25) + 65) ); } | |
$name .= '.pdf'; | |
# Invoke Aspose.Pdf Cloud SDK API to create an empty PDF file | |
my $response = $pdfApi->PutCreateDocument(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
# Download pdf from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = "Sample.pdf"; | |
my $templateFile = "Sample.html"; | |
my $templateType = "html"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $templateFile, file => $data_path.$templateFile); | |
# Invoke Aspose.Pdf Cloud SDK API to create PDF file from HTML | |
$response = $pdfApi->PutCreateDocument(name=>$name, templateFile=>$templateFile, templateType=>$templateType); | |
if($response->{'Status'} eq 'OK'){ | |
# Download pdf from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = "Sample-xml.pdf"; | |
my $templateFile = "sample.xsl"; | |
my $dataFile = "sample.xml"; | |
my $templateType = "xml"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $templateFile, file => $data_path.$templateFile); | |
# Invoke Aspose.Pdf Cloud SDK API to create PDF file from xml | |
$response = $pdfApi->PutCreateDocument(name=>$name, templateFile=>$templateFile, dataFile=>$dataFile, templateType=>$templateType); | |
if($response->{'Status'} eq 'OK'){ | |
# Download pdf from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = "Sample-jpeg.pdf"; | |
my $templateFile = "Einstein_JPEG.jpg"; | |
my $templateType = "jpeg"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $templateFile, file => $data_path.$templateFile); | |
# Invoke Aspose.Pdf Cloud SDK API to create PDF file from JPEG | |
$response = $pdfApi->PutCreateDocument(name=>$name, templateFile=>$templateFile, templateType=>$templateType); | |
if($response->{'Status'} eq 'OK'){ | |
# Download pdf from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = "Sample-svg.pdf"; | |
my $templateFile = "Example.svg"; | |
my $templateType = "svg"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $templateFile, file => $data_path.$templateFile); | |
# Invoke Aspose.Pdf Cloud SDK API to create PDF file from SVG | |
$response = $pdfApi->PutCreateDocument(name=>$name, templateFile=>$templateFile, templateType=>$templateType); | |
if($response->{'Status'} eq 'OK'){ | |
# Download pdf from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = "Sample-tiff.pdf"; | |
my $templateFile = "Sample.tiff"; | |
my $templateType = "tiff"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $templateFile, file => $data_path.$templateFile); | |
# Invoke Aspose.Pdf Cloud SDK API to create PDF file from tiff | |
$response = $pdfApi->PutCreateDocument(name=>$name, templateFile=>$templateFile, templateType=>$templateType); | |
if($response->{'Status'} eq 'OK'){ | |
# Download pdf from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::MergeDocuments; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-merged.pdf'; | |
my $mergefilename1 = 'Sample.pdf'; | |
my $mergefilename2 = 'sample-input.pdf'; | |
my @mergeDocumentsBody = AsposePdfCloud::Object::MergeDocuments->new('List' => [$mergefilename1,$mergefilename2 ]); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
$response = $storageApi->PutCreate(Path => $mergefilename1, file => $data_path.$mergefilename1); | |
$response = $storageApi->PutCreate(Path => $mergefilename2, file => $data_path.$mergefilename2); | |
# Invoke Aspose.Pdf Cloud SDK API to merge multiple PDF files | |
$response = $pdfApi->PutMergeDocuments(name=>$name,body=>@mergeDocumentsBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download merged document from storage server | |
my $output_file = $out_path. 'merged-' . $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all document properties | |
$response = $pdfApi->GetDocumentProperties(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $docProp (@{$response->{'DocumentProperties'}->{'List'}}){ | |
print "\n $docProp->{'Name'} :: $docProp->{'Value'}"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
my $propertyName = 'author'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get a particular document property | |
$response = $pdfApi->GetDocumentProperty(name=>$name,propertyName=>$propertyName); | |
if($response->{'Status'} eq 'OK'){ | |
my $docProp = $response->{'DocumentProperty'}; | |
print "\n $docProp->{'Name'} :: $docProp->{'Value'}"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to remove all document properties | |
$response = $pdfApi->DeleteProperties(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n File properties have been removed successfully"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::DocumentProperty; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
my $propertyName = 'AsposeDev'; | |
my @documentPropertyBody = AsposePdfCloud::Object::DocumentProperty->new('Name' => 'AsposeDev', 'Value'=>'Farooq Sheikh', 'BuiltIn'=>'False' ); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to set a PDF document property | |
$response = $pdfApi->PutSetProperty(name=>$name,propertyName=>$propertyName, body=>@documentPropertyBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $docProp = $response->{'DocumentProperty'}; | |
print "\n $docProp->{'Name'} :: $docProp->{'Value'}"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposePdfCloud::Object::TextReplace; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Rectangle; | |
use AsposePdfCloud::Object::Signature; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my @textReplaceBody = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample PDF', 'NewValue' => 'Sample Aspose PDF'); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.PDF Cloud SDK API to replace pdf text | |
$response = $pdfApi->PostDocumentReplaceText(name=>$name, body=>@textReplaceBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposePdfCloud::Object::TextReplace; | |
use AsposePdfCloud::Object::TextReplaceListRequest; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Rectangle; | |
use AsposePdfCloud::Object::Signature; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my @tr1 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample', 'NewValue' => 'Sample Aspose'); | |
my @tr2 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'PDF', 'NewValue' => 'Aspose PDF'); | |
my @textReplaceListRequestBody = AsposePdfCloud::Object::TextReplaceListRequest->new('TextReplaces' => [@tr1, @tr2]); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.PDF Cloud SDK API to replace pdf text list | |
$response = $pdfApi->PostDocumentReplaceTextList(name=>$name, body=>@textReplaceListRequestBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Rectangle; | |
use AsposePdfCloud::Object::Signature; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input-2.pdf'; | |
my $signatureFileName = 'pkc7-sample.pfx'; | |
my @rect = AsposePdfCloud::Object::Rectangle->new('X' => 100, 'Y' => 100, 'Height' => 100, 'Width' => 200); | |
my @textReplaceListRequestBody = AsposePdfCloud::Object::Signature->new( | |
'Authority' => 'Naeem Akram', | |
'Location' => 'Gojra', | |
'Contact' => '[email protected]', | |
'Date' => '05/09/2016 2:00:00.000 AM', | |
'FormFieldName' => 'Signature1', | |
'Password' => 'aspose', | |
'SignaturePath' => $signatureFileName, | |
'SignatureType' => 'PKCS7', | |
'Visible' => 'True', | |
'Rectangle' => @rect | |
); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
$response = $storageApi->PutCreate(Path => $signatureFileName, file => $data_path.$signatureFileName); | |
# Invoke Aspose.Pdf Cloud SDK API to sign PDF document | |
$response = $pdfApi->PostSignDocument(name=>$name, body=>@textReplaceListRequestBody); | |
if($response->{'Status'} eq 'OK'){ | |
#download signed pdf from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::MergeDocuments; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $format = 'pdf'; | |
my $from = 1; | |
my $to = 2; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to split all or specific pages of a PDF | |
$response = $pdfApi->PostSplitDocument(name=>$name, format=>$format, from=>$from, to=>$to); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $splitDoc (@{$response->{'Result'}->{'Documents'}}){ | |
my $urlString = $splitDoc->{'Href'}; | |
print "\n Split Doc Href :: " . $urlString; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Field; | |
use AsposePdfCloud::Object::Rectangle; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-field.pdf'; | |
my $page = 1; | |
my @rect = AsposePdfCloud::Object::Rectangle->new('X' => 100, 'Y' => 100, 'Height' => 100, 'Width' => 200); | |
my @fieldbody = AsposePdfCloud::Object::Field->new('Name' => 'checkBoxField2', 'Values'=>['1'], 'Type'=>'Boolean', 'Rect' => @rect); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to create form field in a PDF document | |
$response = $pdfApi->PostCreateField(name=>$name,page=>$page, body=>@fieldbody); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input-2.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all of the form fields from the PDF document | |
$response = $pdfApi->GetFields(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $field (@{$response->{'Fields'}->{'List'}}){ | |
print "\n $field->{'Name'}"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-field.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all of the form fields from the PDF document | |
$response = $pdfApi->GetFields(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Count :: ". scalar(@{$response->{'Fields'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-field.pdf'; | |
my $fieldName = 'textbox1'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get a particular form field from the PDF document | |
$response = $pdfApi->GetField(name=>$name, fieldName=>$fieldName); | |
if($response->{'Status'} eq 'OK'){ | |
my $field = $response->{'Field'}; | |
print "\n $field->{'Name'} :: $field->{'Values'}[0]"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Field; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-field.pdf'; | |
my $fieldName = 'textbox1'; | |
my @fieldbody = AsposePdfCloud::Object::Field->new('Name' => 'textbox1', 'Values'=>['Aspose']); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to update form fields in a PDF document | |
$response = $pdfApi->PutUpdateField(name=>$name, fieldName=>$fieldName, body=>@fieldbody); | |
if($response->{'Status'} eq 'OK'){ | |
my $field = $response->{'Field'}; | |
print "\n $field->{'Name'} :: $field->{'Values'}[0]"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $fileName = 'SampleImage'; | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my $imageNumber = 1; | |
my $format ='jpeg'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to extract a particular image from a PDF page | |
$response = $pdfApi->GetImageWithFormat(name=>$name, pageNumber=>$pageNumber, imageNumber=>$imageNumber, format=>$format); | |
if($response->{'Status'} eq 'OK'){ | |
#download image from response | |
my $output_file = 'C:/temp/'. $fileName . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $fileName = 'SampleImage'; | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my $imageNumber = 1; | |
my $format ='jpeg'; | |
my $width = 200; | |
my $height = 200; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to extract a particular image from a PDF page with specified size | |
$response = $pdfApi->GetImageWithFormat(name=>$name, pageNumber=>$pageNumber, imageNumber=>$imageNumber, format=>$format, width=>$width, height=>$height); | |
if($response->{'Status'} eq 'OK'){ | |
# Download image from response | |
my $output_file = $out_path. $fileName . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get image count from a PDF page | |
$response = $pdfApi->GetImages(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Image Count :: ". scalar(@{$response->{'Images'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my $imageNumber = 1; | |
my $format ='jpeg'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.PDF Cloud SDK API to get image with format | |
$response = $pdfApi->GetImageWithFormat(name=>$name, pageNumber=>$pageNumber, imageNumber=>$imageNumber, format=>$format); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my $imageNumber = 1; | |
my $imageFile = 'aspose-cloud.png'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
$response = $storageApi->PutCreate(Path => $imageFile, file => $data_path.$imageFile); | |
# Invoke Aspose.Pdf Cloud SDK API to replace an image in a PDF | |
$response = $pdfApi->PostReplaceImage(name=>$name, pageNumber=>$pageNumber, imageNumber=>$imageNumber, imageFile => $imageFile); | |
if($response->{'Status'} eq 'OK'){ | |
# Download updated document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my $imageNumber = 1; | |
my $imageFile = 'aspose-cloud.png'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to replace an image in a PDF | |
$response = $pdfApi->PostReplaceImage(name=>$name, pageNumber=>$pageNumber, imageNumber=>$imageNumber, file => $data_path.$imageFile); | |
if($response->{'Status'} eq 'OK'){ | |
# Download updated document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all links from a PDF page | |
$response = $pdfApi->GetPageLinkAnnotations(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
my $linkAnnotations = $response->{'Links'}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all links from a PDF page | |
$response = $pdfApi->GetPageLinkAnnotations(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Count :: ". scalar(@{$response->{'Links'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
my $linkIndex = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get a specific link from a PDF page | |
$response = $pdfApi->GetPageLinkAnnotationByIndex(name=>$name, pageNumber=>$pageNumber, linkIndex=>$linkIndex); | |
if($response->{'Status'} eq 'OK'){ | |
my $linkAnnotation = $response->{'Link'}; | |
print "\n Action Type :: ". $linkAnnotation->{'ActionType'}; | |
print "\n Action :: ". $linkAnnotation->{'Action'}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to add a new page | |
$response = $pdfApi->PutAddNewPage(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $filename = 'sample-input'; | |
my $name = $filename . '.pdf'; | |
my $pageNumber = 1; | |
my $format = "png"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to convert pdf page to image | |
$response = $pdfApi->GetPageWithFormat(name=>$name, pageNumber=>$pageNumber , format=>$format); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from response | |
my $output_file = $out_path. $filename . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $filename = 'sample-input'; | |
my $name = $filename . '.pdf'; | |
my $pageNumber = 1; | |
my $format = "png"; | |
my $width = 300; | |
my $height = 300; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to convert pdf page to image | |
$response = $pdfApi->GetPageWithFormat(name=>$name, pageNumber=>$pageNumber , format=>$format, width=>$width, height=>$height); | |
if($response->{'Status'} eq 'OK'){ | |
#download document from response | |
my $output_file = $out_path. $filename . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to delete a page from a PDF | |
$response = $pdfApi->DeletePage(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all PDF document pages | |
$response = $pdfApi->GetPages(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Total Page Count :: ". scalar(@{$response->{'Pages'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Annotation.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get page information | |
$response = $pdfApi->GetPage(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all PDF document pages | |
$response = $pdfApi->GetWordsPerPage(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nGet Words Count per Page :: Done"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-merged.pdf'; | |
my $pageNumber = 1; | |
my $newIndex = 2; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to move a page to new locations in a PDF | |
$response = $pdfApi->PostMovePage(name=>$name, pageNumber=>$pageNumber, newIndex=>$newIndex); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::TextReplace; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $pageNumber = 1; | |
my @mergeDocumentsBody = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample PDF', 'NewValue' => 'Sample Aspose PDF'); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.PDF Cloud SDK API to replace pdf document page text | |
$response = $pdfApi->PostPageReplaceText(name=>$name, pageNumber=>$pageNumber, body=>@mergeDocumentsBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::TextReplace; | |
use AsposePdfCloud::Object::TextReplaceListRequest; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $pageNumber = 1; | |
my @tr1 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample PDF', 'NewValue' => 'Sample Aspose PDF'); | |
my @tr2 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample PDF', 'NewValue' => 'Sample Aspose PDF'); | |
my @textReplaceListRequestBody = AsposePdfCloud::Object::TextReplaceListRequest->new('TextReplaces' => [@tr1, @tr2]); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.PDF Cloud SDK API to replace pdf document page text list | |
$response = $pdfApi->PostPageReplaceTextList(name=>$name, pageNumber=>$pageNumber, body=>@textReplaceListRequestBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::Object::Rectangle; | |
use AsposePdfCloud::Object::Signature; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $pageNumber = 1; | |
my $signatureFileName = 'pkc7-sample.pfx'; | |
my @rect = AsposePdfCloud::Object::Rectangle->new('X' => 100, 'Y' => 100, 'Height' => 100, 'Width' => 200); | |
my @signatureBody = AsposePdfCloud::Object::Signature->new( | |
'Authority' => 'Naeem Akram', | |
'Location' => 'Gojra', | |
'Contact' => '[email protected]', | |
'Date' => '04/20/2017 2:00:00.000 AM', | |
'FormFieldName' => 'Signature1', | |
'Password' => 'aspose', | |
'SignaturePath' => $signatureFileName, | |
'SignatureType' => 'PKCS7', | |
'Visible' => 'True', | |
'Rectangle' => @rect | |
); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
$response = $storageApi->PutCreate(Path => $signatureFileName, file => $data_path.$signatureFileName); | |
# Invoke Aspose.Pdf Cloud SDK API to sign pdf page | |
$response = $pdfApi->PostSignPage(name=>$name, pageNumber=>$pageNumber, body=>@signatureBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get fragments from a particular page | |
$response = $pdfApi->GetFragments(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Count :: ". scalar(@{$response->{'TextItems'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
my $fragmentNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get segments from a particular fragment | |
$response = $pdfApi->GetSegments(name=>$name, pageNumber=>$pageNumber, fragmentNumber=>$fragmentNumber); | |
if($response->{'Status'} eq 'OK'){ | |
print "\n Count :: ". scalar(@{$response->{'TextItems'}->{'List'}}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
my $fragmentNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get text format of a particular fragment | |
$response = $pdfApi->GetFragmentTextFormat(name=>$name, pageNumber=>$pageNumber, fragmentNumber=>$fragmentNumber); | |
if($response->{'Status'} eq 'OK'){ | |
my $segTextFormat = $response->{'TextFormat'}; | |
print "\n FontName :: " . $segTextFormat->{'FontName'}; | |
print "\n FontSize :: " . $segTextFormat->{'FontSize'}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
my $fragmentNumber = 1; | |
my $segmentNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get text format of a particular segment | |
$response = $pdfApi->GetSegmentTextFormat(name=>$name, pageNumber=>$pageNumber, fragmentNumber=>$fragmentNumber, segmentNumber=>$segmentNumber); | |
if($response->{'Status'} eq 'OK'){ | |
my $segTextFormat = $response->{'TextFormat'}; | |
print "\n FontName :: " . $segTextFormat->{'FontName'}; | |
print "\n FontSize :: " . $segTextFormat->{'FontSize'}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all text items from PDF | |
$response = $pdfApi->GetTextItems(name=>$name); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $textItem (@{$response->{'TextItems'}->{'List'}}){ | |
print "\n Text :: " . $textItem->{'Text'}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all text items from a particular PDF page | |
$response = $pdfApi->GetPageTextItems(name=>$name, pageNumber=>$pageNumber); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $textItem (@{$response->{'TextItems'}->{'List'}}){ | |
print "\n Text :: " . $textItem->{'Text'}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'Sample-Bookmark.pdf'; | |
my $pageNumber = 1; | |
my $fragmentNumber = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to get all text items from a particular fragment | |
$response = $pdfApi->GetFragment(name=>$name, pageNumber=>$pageNumber, fragmentNumber=>$fragmentNumber); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $textItem (@{$response->{'TextItems'}->{'List'}}){ | |
print "\n Text :: " . $textItem->{'Text'}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::TextReplace; | |
use AsposePdfCloud::Object::TextReplaceListRequest; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $pageNumber = 1; | |
my @tr1 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample', 'NewValue' => 'Sample Aspose'); | |
my @tr2 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'PDF', 'NewValue' => 'Aspose PDF'); | |
my @textReplaceListRequestBody = AsposePdfCloud::Object::TextReplaceListRequest->new('TextReplaces' => [@tr1, @tr2]); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to replace multiple texts in a PDF page | |
$response = $pdfApi->PostDocumentReplaceTextList(name=>$name, pageNumber=>$pageNumber, body=>@textReplaceListRequestBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download updated document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::TextReplace; | |
use AsposePdfCloud::Object::TextReplaceListRequest; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my @tr1 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample', 'NewValue' => 'Sample Aspose'); | |
my @tr2 = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'PDF', 'NewValue' => 'Aspose PDF'); | |
my @textReplaceListRequestBody = AsposePdfCloud::Object::TextReplaceListRequest->new('TextReplaces' => [@tr1, @tr2]); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to replace multiple texts in a PDF page | |
$response = $pdfApi->PostDocumentReplaceTextList(name=>$name, body=>@textReplaceListRequestBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download updated document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::TextReplace; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my @textReplaceBody = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample PDF', 'NewValue' => 'Sample Aspose PDF'); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to replace text in a PDF | |
$response = $pdfApi->PostDocumentReplaceText(name=>$name, body=>@textReplaceBody); | |
if($response->{'Status'} eq 'OK'){ | |
#download updated document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::TextReplace; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $pageNumber = 1; | |
my @textReplaceBody = AsposePdfCloud::Object::TextReplace->new('OldValue' => 'Sample PDF', 'NewValue' => 'Sample Aspose PDF'); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to replace text within a pdf page | |
$response = $pdfApi->PostPageReplaceText(name=>$name, pageNumber=>$pageNumber, body=>@textReplaceBody); | |
if($response->{'Status'} eq 'OK'){ | |
#download updated document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Stamp; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my $imageFile = 'aspose-cloud.png'; | |
my @stampBody = AsposePdfCloud::Object::Stamp->new('FileName' => $imageFile, | |
'Background' => 'True', | |
'Type' => 'Image', | |
'PageIndex' => 0, | |
'LeftMargin' => 0.0, | |
'Opacity' => 0.5, | |
'RightMargin' => 0.0, | |
'TopMargin' => 0.0, | |
'YIndent' => 100.0, | |
'XIndent' => 100.0, | |
'Zoom' => 1.0, | |
'Width' => 300.0, | |
'Height' => 300.0 ); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
$response = $storageApi->PutCreate(Path => $imageFile, file => $data_path.$imageFile); | |
# Invoke Aspose.Pdf Cloud SDK API to insert watermark image as stamp to a PDF page | |
$response = $pdfApi->PutPageAddStamp(name=>$name, pageNumber=>$pageNumber, body=>@stampBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Stamp; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my @stampBody = AsposePdfCloud::Object::Stamp->new( | |
'PageIndex' => 1, | |
'Value' => 'Page # of 2', | |
'Type' => 'PageNumber', | |
'StartingNumber' => 1, | |
'LeftMargin' => 0.0, | |
'Opacity' => 0.5, | |
'RightMargin' => 0.0, | |
'TopMargin' => 0.0, | |
'YIndent' => 100.0, | |
'XIndent' => 100.0, | |
'Zoom' => 1.0, | |
'Width' => 300.0, | |
'Height' => 300.0 ); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to insert page number stamp to a PDF page | |
$response = $pdfApi->PutPageAddStamp(name=>$name, pageNumber=>$pageNumber, body=>@stampBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Stamp; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'SampleImage.pdf'; | |
my $pageNumber = 1; | |
my $pdfName = 'Sample.pdf'; | |
my @stampBody = AsposePdfCloud::Object::Stamp->new( | |
'FileName' => $pdfName, | |
'PageIndex' => 1, | |
'Value' => '', | |
'Background' => 'True', | |
'Type' => 'Page', | |
'LeftMargin' => 0.0, | |
'Opacity' => 0.5, | |
'RightMargin' => 0.0, | |
'TopMargin' => 0.0, | |
'YIndent' => 100.0, | |
'XIndent' => 100.0, | |
'Zoom' => 1.0, | |
'Width' => 300.0, | |
'Height' => 300.0, | |
'StartingNumber' => 0 ); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
$response = $storageApi->PutCreate(Path => $pdfName, file => $data_path.$pdfName); | |
# Invoke Aspose.Pdf Cloud SDK API to insert page of one PDF as watermark or stamp to another PDF page | |
$response = $pdfApi->PutPageAddStamp(name=>$name, pageNumber=>$pageNumber, body=>@stampBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposePdfCloud::PdfApi; | |
use AsposePdfCloud::ApiClient; | |
use AsposePdfCloud::Configuration; | |
use AsposePdfCloud::Object::Stamp; | |
my $configFile = '../config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposePdfCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposePdfCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposePdfCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Pdf API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $pdfApi = AsposePdfCloud::PdfApi->new(); | |
# Set input file name | |
my $name = 'sample-input.pdf'; | |
my $pageNumber = 1; | |
my @stampBody = AsposePdfCloud::Object::Stamp->new( | |
'Value' => 'Aspose.com', | |
'Background' => 'True', | |
'Type' => 'Text' ); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Pdf Cloud SDK API to insert watermark text as stamp to a PDF page | |
$response = $pdfApi->PutPageAddStamp(name=>$name, pageNumber=>$pageNumber, body=>@stampBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download document from storage server | |
my $output_file = $out_path. $name; | |
$response = $storageApi->GetDownload(Path => $name); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment