Comments (12)
Okay, I assume the issue is something to do with how tabulizer runs the file through localize_file()
. Do you know what your shiny app gives as the value of inFile$datapath
?
from tabulapdf.
I see.
inFile$datapath
gives a temporary folder of the form "/var/folders/v4/gmb8wwgx1jj_94hdm2rc4bjh0000gn/T//RtmpYGRbyk/ced0c48b4af993d4d1ca7da4/0". Interestingly this path seem to change when a new file is uploaded. The other values (name, size) in the input$file1
/ inFile
- dataframe are also updated, but the output displayed is not.
I have also tried different uses of reactive
and reactiveValues
-statements to force a resetting of the cache, but have not succeeded so far.
And cudos for the swift reply.
from tabulapdf.
Do you have any suggestions or workarounds to this problem?
If the app only needs to function RStudio you could use the base R-command file.choose
instead of fileInput
. But I'm interested in a browser-app.
from tabulapdf.
I experience the same issue. When uploading a file, Shiny will write it to subdirectory below a temporary directory. load_doc
will call localize_file
with copy = TRUE
, which will make a copy of the uploaded file. In later calls, this file never seems to get replaced.
I cloned the repo and ran with some edits locally. If I change the copy
parameter in load_doc
from TRUE to FALSE (line 23 of utils.R), everything works as expected.
I'd submit a pull request, but I'm not 100% clear on the mechanism which produces the error, nor the purpose of COPY
in localize_file
.
from tabulapdf.
A bit more on this. I think the more significant issue is with regard to line 13 in utils.R. The default behavior for file.copy
is NOT to overwrite the file if it already exists. The way that Shiny uploads files is such that they will always exist in a subfolder of tempdir()
and will have a basename of "0" or some such. localize_file
will take its source and copy it to tempdir()
. On the second call, there is already a file with a name like "0.pdf" at that location. Because we're not passing in overwrite = TRUE
, the copy never takes place. This is a very easy change, that I've tested for my specific use case. I'll go ahead and submit a pull request.
from tabulapdf.
While using extract_areas in a shiny app, it is giving an Error: Can't call runApp()
from within runApp()
. If your application code contains runApp()
, please remove it.
I understand, extract_areas is built as a shiny based functionality but I want to upload PDFs using shing InputFile and id pages to locate areas and extract.
Is there simple way to get the same?
Thanks in advance
from tabulapdf.
@abhivedula You can't use extract_areas()
in a shiny app because it is a shiny app. If you want to use the underlying functionality, pass input to extract_tables()
.
from tabulapdf.
Thanks for the reply Leeper. I have an additional question. Can we develop a customized version extract_areas as shiny app to host online ?
from tabulapdf.
You're more than welcome to. This package is licensed MIT, so as long as you comply with that you should be good to go.
from tabulapdf.
Sorry to bother you. One last question on this topic. I am developing a shiny app to host in shinyapps.io. It should have a file upload feature and once we upload PDF, it should give option to select areas for extract tables just like the extract_areas feature which does that in viewer.
I am relatively new to R so please bear with my ignorance.
from tabulapdf.
I am not a shiny expert so I really can't provide any assistance with that.
from tabulapdf.
Thanks a lot leeper. Btw tabulizer is awesome :)
from tabulapdf.
Related Issues (20)
- Select multiple areas per page in `*_areas()`
- q question about package( Tabulizer) installation HOT 4
- a suggested code or documentation change, improvement to the code, or feature request HOT 1
- inconsistent behavior of extract_tables and extract_areas HOT 4
- Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.lang.IllegalAccessException: class RJavaTools cannot access a member of class java.util.ArrayList$Itr (in module java.base) with modifiers "public" HOT 11
- New Maintainer Wanted :-) HOT 6
- An illegal reflective access operation has occurred HOT 1
- Renaming to tabula HOT 2
- Windows CI fails because of Java 8 requirement HOT 1
- build fails with tabula 1.2.1 jar HOT 1
- ROADMAP FOR FALL 2023 HOT 6
- Unable to install in tabulizer HOT 1
- pkgdown building issue HOT 10
- Is jdk7 -y needed? HOT 6
- Is the package abandoned? HOT 1
- Issue with extract_tables function. Couldn't run the example: getRowCount HOT 4
- Broken link to package documentation, and missing vignette HOT 3
- easier way to install Java for your users with rJavaEnv HOT 2
- How can I get information from checkboxes in tables? HOT 3
- Fatal R error when attempting to extract text from a PDF that includes a particular mathematical symbol HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tabulapdf.