Hi,
we are downloading free version of PDF Net and planning to purchase the product.
Our Requirement is ( IN WPF APPLICATION)
We are reading a PDF file which contents some XML tag, and we need to remove that tag from PDF and create new one.
XML contnets like
/* Some text of PDF /
Other XML Contents
/ Some text of PDF */
we want to remove this xml node from PDF file and create other PDF file.
Our code to read pdf content is below
Document pdfDocument = new Document(“input.pdf”);
TextAbsorber textAbsorber = new TextAbsorber();
pdfDocument.Pages.Accept(textAbsorber);
string extractedText = textAbsorber.Text;
In Extracted Text its always return
"Evaluation Only. Created with Aspose.Pdf. Copyright 2002-2011 Aspose Pty Ltd."
Is this because of evaluation version ?
How can i achieve our task to remove XML node from PDF ? is it Possible with Your product.
Thank You.
Hi Azhar,
Thanks for your interest in our products.
Kindly try to use the latest version of Aspose.PDF for .NET v6.8 and check the following documentation links for details and code snippets as per your requirement.
Please visit Purchase Information for all details about licensing, even before purchasing the license, you may also request a 30 days temporary license for evaluating the product.
Please feel free to contact support in case you need any further assistance.
Thanks & Regards,
Hi
Mohammad Azharuddin,
Thanks for your interest in our products.
Adding more to Rashid’s comments, in order accomplish your requirement, you can replace XML node/string with blank characters. Please visit the following link for instructions on Replace Text Based on a Regular Expression
In case you still face any issue, please feel free to contact. We are sorry for your inconvenience.
Hi Rashid,
As we asked you for text removing in PDF document with ASPOSE.
we are downloading free version of PDF Net and planning to purchase the product.
We are reading a PDF file which contents some XML tag, and we need to remove that tag from PDF and create new one.
XML contnets like
/* Some text of PDF /
Other XML Contents line 1
Other XML Contents line 2
Other XML Contents line 3
Other XML Contents line 4
/ Some text of PDF */
Our code to read pdf content is below
License license = new License();
string licenseFilePath = Path.Combine(INSTALLPATH, “Aspose.Pdf.lic”);
license.SetLicense(licenseFilePath);
Document pdfDocument =
new Document(FILEPATH);
TextAbsorber textAbsorber = new TextAbsorber();
pdfDocument.Pages.Accept(textAbsorber);
string extractedText = textAbsorber.Text;
//NOTE xmlContents are same as described
string[] textReplaceAll = xmlContents.Split(’\n’);
foreach (string textReplace in textReplaceAll)
{
string oText = textReplace.Trim().TrimEnd(’\r’);
//create TextAbsorber object to find all instances of the input search phrase
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(oText);
//set text search option to specify regular expression usage
TextSearchOptions textSearchOptions = new TextSearchOptions(true);
textFragmentAbsorber.TextSearchOptions = textSearchOptions;
//accept the absorber for all the pages
pdfDocument.Pages.Accept(textFragmentAbsorber);
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
//loop through the fragments
foreach (TextFragment textFragment in textFragmentCollection)
{
//update text and other properties
textFragment.Text = String.Empty;
}
}
MemoryStream outStream = new MemoryStream();
pdfDocument.Save(outStream);
In Extracted Text its always return
"Evaluation Only. Created with Aspose.Pdf. Copyright 2002-2011 Aspose Pty Ltd."
Is this because of evaluation version ?
And in new PDF document first line of page is always
"Evaluation Only. Created with Aspose.Pdf. Copyright 2002-2011 Aspose Pty Ltd."
In new PDF document we get below output
Other XML Contents line 4
as you see we are not able to replace all XML Content and its tags,
Only Four lines are replaced by this code.
Is This Because Of Evaluation Version ?
Can It Be Replace All Text From PDF After We Purchase Your Product ?
Thank You.
Hi Mohammad Azharuddin,
Thanks for your inquiry and sharing the sample source code with us.
Yes, the issues you mentioned in you post totally related to Evaluation Version but I am afraid, you are using Aspose.Pdf.lic file in your code, after using this file these issues should be remove. Please make sure that your license subscription is not expired. You may check that by opening your license file in a text editor and check the tag to confirm your license subscription expiry. Can you please confirm this?
Moreover, kindly share the source document with us so that we can test the scenario at our end.
We apologize for your inconvenience.
Thanks & Regards,
Hi Rashid,
Thank you for your quick reply.
Still we are not purchase your product, we used temporary license.
in our license file SubscriptionExpiry is
<SubscriptionExpiry>20130404</SubscriptionExpiry>
Is this problem is because of temporary license ?
Can it will be solve after original purchase ?
Thank You.
Hi Mohammad Azharuddin,
Thanks for sharing the details.
mak_azhar:Still we are not purchase your product, we used temporary license.
in our license file SubscriptionExpiry is
20130404
Is this problem is because of temporary license ?
Can you please share temporary license file with us using instructions shared over How to send your license file to an Aspose staff member? Moreover, kindly share the source PDF document as well so that we can test the scenario at our end. Sorry for the inconvenience.
mak_azhar:
Can it will be solve after original purchase ?
Yes, these issues will definitely resolve in purchased version.
Please feel free to contact support in case you need any further assistance.
Thanks & Regards,