Running Example code in IntelliJ Idea

Hello


I have download example code from git hub and trying to run it according to instruction given on documentation page.

But still facing so many import and decency errors. Please help me to fix it.

BR
Saadia


Hi Saadia,

Thanks for your interest in Aspose. Please double check whether you have followed the given instructions in IntelliJ IDEA section of How to Run the Examples documentation page. However if the issue persist then please share some more details about the issue, so we will guide you accordingly.

We are sorry for the inconvenience.

Best Regards,

I have tried it on net-beans IDE, but facing errors in pom.xml as well as dependency errors through out all the source code.

Hi Saadia,


Thanks for your feedback. I have again tested the Java examples and unable to notice any issue. It seems there is some maven configuration issue in your IDE. Please share your sample pom.xml and error screen shot, so we will check guide you accordingly.

Meanwhile you may create a simple java project, add desired code sample in project and and add reference of Aspose.Pdf for Java jar manually to test the scenario.

We are truly sorry for the inconvenience.

Best Regards,
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
com.aspose
pdf-java-examples
1.0-SNAPSHOT
jar
1.8
1.8
com.aspose
aspose-pdf
11.8.0
javax.media.jai
com.springsource.javax.media.jai.core
1.1.3
aspose-maven-repository
http://maven.aspose.com/repository/repo/
com.springsource.repository.bundles.external
SpringSource Enterprise Bundle Repository - External Bundle Releases
http://repository.springsource.com/maven/bundles/external


here you can find the pom.xml
and the other is: Search dependency at maven repository.

Hi Saadia,

Thanks for sharing the pom.xml. I have same pom.xml file and its working fine at my end.

However, please try following Aspose Maven repository url instead Aspose.PDF | Java PDF Document Processing Class Library and share the results.

http://maven.aspose.com/artifactory/simple/ext-release-local/

Best Regards,

Still facing this error:

Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom


BUILD FAILURE


Total time: 1.527s

Finished at: Mon Aug 29 14:31:24 PKT 2016

Final Memory: 5M/123M


Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): Access denied to: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom , ReasonPhrase:Forbidden ( Forefront TMG denied the specified Uniform Resource Locator (URL). ). -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.

Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:

[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Okay got it the issue was on my end due to a proxy.

Hi Saadia,


Thanks for your feedback and it is good to know that you have identified and fixed the issue.

Please feel free to contact us for any further assistance.

Best Regards,

Hello Tilal


I am trying to run ExtractTextFromAnParticularPageRegion.java based on specified coordinates but it always displays following text as output:

Evaluation Only. Created with Aspose.Pdf. Copyright 2002-2016 Aspose Pty Ltd.


Please help me why it is not displaying the exact text placed in specified rectangular area.

Regards

Hi Saadia,

Thanks for your inquriy. Please note Aspose.Pdf evaluation version has two limitations, evaluation watermark and at most four elements of any collection can be viewed. Please make a request for 30 days temporary license and implement it to evaluate our product without any limitation, your issue will be resolved.

Please feel free to contact us for any further assistance.

Thanks it worked like a magic.



Now another question arises:
How can we select rectangles on a pdf document to specify the coordinates?
(We have to extract specific metadata from a document.)


BR
Saadia

Hi Saadia,


Thanks for the acknowledgement.

We are glad to hear that your problem is resolved.

Now concerning to other query on specifying rectangular coordinates, do you need to extract page contents from certain page region ? If so is the case, then please follow the instructions specified over Extract Text from an particular page region

In case I have not properly understood your requirements, please share some further details.

Yes i have to extract text from specified coordinates of a certain page. To acheive this we first need to have web based PDF Editor, so that user can specify the coordinates that will be used for all other pdf documents.


Regards
Saadia

Hi Saadia,


Thanks for sharing the details.

I am afraid Aspose.Pdf does not support the feature to display PDF documents. However in order to accomplish your requirements, you need to Convert PDF Page to Image format, then render the images in image view control and implement some functionality where user can specify the coordinates / region which which he/she needs to extract the contents.

Once you have the coordinates, you can use the same information to extract text from PDF file. In the event of any further query, please feel free to contact.

Hello Talal


I have been working on your proposed solution, but the coordinates of image are different from pdf respective coordinates.

Any solution to fix the resolution changes issue.

Regards

Hi Saadia,

In addition to Nayyer’s reply, for Web based editor you may check GroupDocs document viewer, a product of our sister concern and may contact GroupDocs support for the details. Hopefully It will help you to accomplish the task graphically.

saadia:
I have been working on your proposed solution, but the coordinates of image are different from pdf respective coordinates.
Any solution to fix the resolution changes issue.

please note Aspose.Pdf page origin is left bottom and its coordinates are (0,0). So rectangle coordinates of page will be x=0,y=0,urx=page width and ury= page height.

For example if you have X,Y,width and height values of a rectangle. And X and Y values are top left coordinates of your rectangle, then you can convert these values to Aspose.Pdf Rectangle parameters as following. However if still there is any confusion then please share some further details and your sample PDF document, so we will look into it and guide you accordingly.

llx=x;
lly=page.Rect.Height-y-height;
urx=x+width;
ury=page.Rect.Height-y;

Best Regards,