[kepler-dev] Including PDF in Vergil
Chad Berkley
berkley at nceas.ucsb.edu
Mon Jul 13 15:37:20 PDT 2009
We do handle the resources for actors, but we just make assumptions
about where they are located. We treat the ptolemy/ptolemy directory as
a source dir so we don't look for resources there. Since ptolemy has a
different organization than kepler, we need to add exclusions/inclusions
based on the different organization. If the pdf file were in
resources/** then it would be found. In order for it to be found where
it is now, I'd have to add all of the ptolemy source into the classpath,
which I don't really want to do because I want to be able to package
kepler with no source files at all.
chad
Christopher Brooks wrote:
> Hi Chad,
> Thanks!
> Right, I had to run
> svn update
> ant update
> to get these changes.
>
> From within Kepler, searching for the PDFAttribute does not find it.
>
> I do get the same error message about sample.pdf missing.
>
> The build system needs to handle the resources that are needed by the
> actors, I'll update http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4244
> in a moment.
>
>
> _Christopher
>
>
>
>
> Chad Berkley wrote:
>> Hey Christopher,
>>
>> I fixed the compile classpath so the jar file is found now. A was
>> able to add the attribute with the tools/Instantiate Attribute menu.
>> Note that the default value (sample.pdf) won't be found in kepler
>> because of the way PTII gets set. I had to copy the sample.pdf file
>> to the right place manually. Maybe should just remove that default or
>> put an if statement in there so that it doesn't throw a moml exception
>> when the default file isn't found.
>>
>> Make sure to update your build-area to get these changes.
>>
>> chad
>>
>>
>> Christopher Brooks wrote:
>>> Hi David,
>>> Kepler fails to build for me after I moved PDFRenderer.jar from
>>> ptII/lib to
>>> ptII/ptolemy/vergil/pdfrenderer. To reproduce this:
>>>
>>> cd build-area
>>> ant update
>>> ant update-ptolemy -Drev=head
>>> ant run
>>>
>>> The error message is:
>>>
>>> compile:
>>> [compile] Compiling ptolemy...
>>> [compile] Compiling 3277 source files to
>>> /Users/cxh/src/kepler/ptolemy/target/classes
>>> [compile]
>>> /Users/cxh/src/kepler/ptolemy/ptolemy/vergil/pdfrenderer/PDFAttribute.java:46:
>>> package com.sun.pdfview does not exist
>>> [compile] import com.sun.pdfview.PDFFile;
>>> [compile] ^
>>>
>>> I updated (but did not check in) build-area/settings/ptolemy-includes
>>> to include:
>>> ptolemy/vergil/pdfrenderer/PDFRenderer.jar
>>>
>>> But running "ant run" has no effect.
>>>
>>> The jar file is present:
>>>
>>> bash-3.2$ ls -l ../ptolemy/ptolemy/vergil/pdfrenderer/PDFRenderer.jar
>>> -rw-r--r-- 1 cxh staff 2087109 Jul 13 11:31
>>> ../ptolemy/ptolemy/vergil/pdfrenderer/PDFRenderer.jar
>>>
>>>
>>> https://kepler-project.org/developers/teams/build/documentation/build-system-instructions#modifying-ptolemy-includes-and
>>>
>>> just says to edit ptolemy-includes, it does not say what, if any,
>>> other commands should be run.
>>>
>>> What else needs to be done when ptolemy-includes is updated?
>>> Is there anyway that this file can have comments in it that indicate
>>> what commands need to be run
>>> and also a link to the docs?
>>>
>>>
>>> Also, at this point the PDFAttribute does not appear in Kepler. I'm
>>> not sure how to add it, though
>>> I have not looked hard at the docs yet.
>>>
>>> _Christopher
>>>
>>>
>>> Edward A. Lee wrote:
>>>>
>>>> I've added a PDFAttribute to the Utilities->Decorative library in
>>>> Vergil
>>>> that allows you to include PDF in a Vergil diagram.
>>>>
>>>> The reason I wanted this was mainly so I could include Latex-formatted
>>>> equations in Vergil diagrams, and get full print resolution when
>>>> printing to PDF for use in papers, books, etc. For example, see
>>>> attached.
>>>>
>>>> Using requires a new external library, PDFRenderer.jar, which I've
>>>> put in $PTII/lib. This is a LGPL'd open source product from Sun.
>>>>
>>>> To use it, I use LatexIt (see
>>>> http://www.apple.com/downloads/macosx/math_science/latexit.html
>>>> for the Mac version... I think there are Windows and Linux versions).
>>>> From LatexIt, I can create a PDF file with an equation.
>>>>
>>>> Then I drag into my Vergil diagram a PDFAttribute, or select
>>>> Edit Custom Icon and drag in a PDFIcon. Double click on that to
>>>> select the PDF file.
>>>>
>>>> To use this, you need to do a CVS update and
>>>> either re-run configure or do
>>>>
>>>> cd $PTII/bin
>>>> make
>>>>
>>>>
>>>> This will put the jar file in the path for vergil.
>>>>
>>>> Edward
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> _______________________________________________
>>>> Kepler-dev mailing list
>>>> Kepler-dev at kepler-project.org
>>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>>
>
More information about the Kepler-dev
mailing list