public Object construct() {
                            // save the file
                            String error;
                            try {
                                // It is important to create a UTF-8 encoded file.
                                OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
                                SVG.createSVG(
                                        doc,
                                        pageIndex,
                                        out);
                                out.close();
                                error = null;
                            } catch (Throwable e) {
                                error = e.getMessage();
                                logger.log(Level.FINE, "Error exporting to SVG");
                            }
                            final String tmpMsg;
                            // finsished message
                            if (error != null) {
                                Object[] messageArguments = new Object[]{
                                        String.valueOf(pageIndex + 1),
                                        file.getName()
                                };
                                MessageFormat formatter =
                                        new MessageFormat(
                                                messageBundle.getString("viewer.dialog.exportSVG.status.exporting.msg"));
                                tmpMsg = formatter.format(messageArguments);
                            }
                            // problem message
                            else {
                                Object[] messageArguments = new Object[]{
                                        String.valueOf(pageIndex + 1),
                                        file.getName(),
                                        error
                                };
                                MessageFormat formatter = new MessageFormat(
                                        messageBundle.getString("viewer.dialog.exportSVG.status.error.msg"));
                                tmpMsg = formatter.format(messageArguments);
                            }
                            final String msg = tmpMsg;

                            Runnable doSwingWork = new Runnable() {
                                public void run() {
                                    if (statusLabel != null)
                                        statusLabel.setText(msg);
                                }
                            };
                            SwingUtilities.invokeLater(doSwingWork);
                            return null;
                        }