How can I open and later close PDFs from appdesigner (for viewing PDFs only, not data extraction)?

26 visualizaciones (últimos 30 días)
Hello,
I am creating an app in appdesigner (R2019b) to quality check some data. The data is exported from another program as PDF files that contains a few pages of images of raw data (gait biomechanics and electromyography waveforms for each participant in our study). I would like for the app to open a PDF, allow the user to look through the PDF, interact with my app to tell the app which data is good or bad based on visual inspection of the PDF, then close the PDF and go to the next participant's PDF when the user clicks a "next" button in the app.
I was hoping to use:
fileName = 'P511_baseline.pdf';
[fid,msg] = fopen(fileName);
so that I could later close it with
fclose(fid)
but this doesn't seem to actually open the PDF for viewing, only for writing.
I was able to get the PDF to open for viewing using:
unix(['open "' fileName '" &']);
However, I haven't been able to figure out how to close it when opening it in this way. For some quality checking protocols, the user will need to check a few hundred PDFs so it would be best to be able to close them automatically from within the code, rather than the user closing them manually. Additionally, because some of the PDFs have very similar names (e.g. P511_baseline and P551_baseline), to reduce the chances that the user is looking at the wrong PDF when performing the quality check, it is essential that only one PDF is open at a time. Ideally, I would like to find a solution(s) that work for PC and Mac because this app will be used on both systems.
Most of the Matlab Answers I have seen so far are about reading data from PDFs. I do NOT need to read any data from the PDFs. I just want them to open so the user can look at them visually - this could be in a PDF application (e.g. Adobe Acrobat, Preview, etc.) or as some kind of image file within Matlab - but I do need the ability to open and close each one individually. I would appreciate any suggestions anyone has for how to do this!
Thanks.

Respuestas (1)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi el 21 de Abr. de 2020
Hi,
You could use 'open' function to open a .pdf file in adobe. For more information on this function refer to the following link
There is no direct function to close an opened pdf file as it is opened in some other application. After your tasks with the file are done, probably closing adobe might serve as a work around. You could do so as mentioned at the below link
This is a work around if you could work on windows.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by