Search in sources :

Example 1 with CompilePdfEvent

use of org.rstudio.studio.client.workbench.views.output.compilepdf.events.CompilePdfEvent in project rstudio by rstudio.

the class TextEditingTarget method fireCompilePdfEvent.

private void fireCompilePdfEvent(String path, String encoding, String completedAction, boolean useInternalPreview) {
    // first validate the path to make sure it doesn't contain spaces
    FileSystemItem file = FileSystemItem.createFile(path);
    if (file.getName().indexOf(' ') != -1) {
        globalDisplay_.showErrorMessage("Invalid Filename", "The file '" + file.getName() + "' cannot be compiled to " + "a PDF because TeX does not understand paths with spaces. " + "If you rename the file to remove spaces then " + "PDF compilation will work correctly.");
        return;
    }
    CompilePdfEvent event = new CompilePdfEvent(compilePdfHelper_.getTargetFile(file), encoding, getSelectionAsSourceLocation(false), completedAction, useInternalPreview);
    events_.fireEvent(event);
}
Also used : FileSystemItem(org.rstudio.core.client.files.FileSystemItem) CompilePdfEvent(org.rstudio.studio.client.workbench.views.output.compilepdf.events.CompilePdfEvent)

Aggregations

FileSystemItem (org.rstudio.core.client.files.FileSystemItem)1 CompilePdfEvent (org.rstudio.studio.client.workbench.views.output.compilepdf.events.CompilePdfEvent)1