Hello trying to use: GitHub - aspose-pdf-cloud/aspose-pdf-cloud-ruby: Ruby library for communicating with the Aspose.PDF Cloud API
Object reference not set to an instance of an object. |
Hello trying to use: GitHub - aspose-pdf-cloud/aspose-pdf-cloud-ruby: Ruby library for communicating with the Aspose.PDF Cloud API
Object reference not set to an instance of an object. |
Hi Matthew,
Hi Mathew,
Thanks for your patience. Your reported issue has been fixed. Please download the latest Ruby SDK of Aspose.PDF Cloud. Hopefully, now it will help you to accomplish your requirements.
Please feel free to contact us for any further assistance.
Best Regards,
As an update, please note we have released a new API Version V3.0 of Aspose.PDF Cloud API. It is more simplified and better in memory management than older versions. Please find the sample code for replacing text in a PDF document for reference. Kindly also check updated Ruby SDK of Aspose.PDF Cloud and feel free to contact us for any assistance in this regard.
def test_post_document_text_replace
file_name = 'marketing.pdf'
rect = Rectangle.new
rect.llx = 100
rect.lly = 100
rect.urx = 300
rect.ury = 300
text_replace = TextReplace.new
text_replace.old_value = 'market'
text_replace.new_value = 'm_a_r_k_e_t'
text_replace.regex = false
text_replace.rect = rect
text_replace_list = TextReplaceListRequest.new
text_replace_list.text_replaces = [text_replace]
text_replace_list.start_index = 0
text_replace_list.count_replace = 0
opts = {
:folder => @temp_folder
}
response = @pdf_api.post_document_text_replace(file_name, text_replace_list, opts)
end