Problems compiling modified ZeroClipboardPdf.as file to swf

Problems compiling modified ZeroClipboardPdf.as file to swf

chamanchaman Posts: 7Questions: 2Answers: 0
edited October 2014 in Free community support

In order to change the header and table border colours in the PDF created by tabletools I have changed the ZeroClipboardPdf.as lines 240, 243 and 244 from:

new RGBColor (0xE0E0E0),  /* 4. headerColor */
new RGBColor ( 0x0 ),     /* 7. borderColor */
.1,                       /* 8. border alpha */

to:

new RGBColor (0xCCCCCC),  /* 4. headerColor */
new RGBColor (0x000000),  /* 7. borderColor */
1,                        /* 8. border alpha */

I downloaded the flex_sdk from here: http://www.adobe.com/devnet/flex/flex-sdk-download-all.html
I moved it to my C drive (Windows XP SP3) and put the .as file in the same folder as the mxmlc.exe file (ie flex_sdk_4.6\bin) and tried to compile it. The first error I got was:

C:\flex_sdk_4.6\bin>mxmlc.exe ZeroClipboardPdf.as
Loading configuration file C:\flex_sdk_4.6\frameworks\flex-config.xml
C:\flex_sdk_4.6\bin\ZeroClipboardPdf.as: Error: A file found in a source-path 'Z
eroClipboardPdf' must have the same name as the class definition inside the file
 'ZeroClipboard'.

So I renaming file to ZeroClipboard.as and tried again, with the follow error:

C:\flex_sdk_4.6\bin>mxmlc.exe ZeroClipboard.as
Loading configuration file C:\flex_sdk_4.6\frameworks\flex-config.xml
C:\flex_sdk_4.6\bin\ZeroClipboard.as(182): col: 32 Error: Type was not found or
was not a compile-time constant: PDF.

                private function configPdf():PDF
                                             ^

What am I doing wrong?

I did try mxmlc --target-player=10.0.0 -static-link-runtime-shared-libraries=true -library-path+=lib ZeroClipboardPdf.as as written at the top of the .as file, however it did not work until I had modified it to mxmlc --target-player=11.1.0 -static-link-runtime-shared-libraries=true -library-path+=..\frameworks\libs ZeroClipboardPdf.as and then it gave the same errors as above.

This question has an accepted answers - jump to answer

Answers

  • chamanchaman Posts: 7Questions: 2Answers: 0

    Can anybody help?

  • allanallan Posts: 61,933Questions: 1Answers: 10,154 Site admin
    edited November 2014

    Looks like the AlivePDF library is not being linked correctly. Do you have that swc file file at the path specified in your compile command?

    Allan

  • chamanchaman Posts: 7Questions: 2Answers: 0
    edited November 2014

    I didn't have the AlivePDF.swc file, but I have now downloaded v0.1.4.9 it from here: https://code.google.com/p/alivepdf/downloads/list (Sorry this is all new and I didn't realise it was a separate thing).

    I have the .as file in the "C:\flex_sdk_4.6\bin\" directory.
    I have now the AlivePDF.swc in "C:\flex_sdk_4.6\bin\" directory too.

    There is a "playerglobal.swc" in "C:\flex_sdk_4.6\frameworks\libs\player\11.1" directory

    Retried:
    C:\flex_sdk_4.6\bin>mxmlc.exe ZeroClipboard.as
    And:
    mxmlc --target-player=11.1.0 -static-link-runtime-shared-libraries=true -library-path+=..\frameworks\libs ZeroClipboard.as

    Both return the same error as before:

    Loading configuration file C:\flex_sdk_4.6\frameworks\flex-config.xml
    C:\flex_sdk_4.6\bin\ZeroClipboard.as(182): col: 32 Error: Type was not found or
    was not a compile-time constant: PDF.
    
                    private function configPdf():PDF
                                                 ^
    

    Is there a way to test my set-up?

  • chamanchaman Posts: 7Questions: 2Answers: 0

    I copied the AlivePDF.swc file into "C:\flex_sdk_4.6\frameworks\libs" and now the errors are about "CoreFont":
    C:\flex_sdk_4.6\bin\ZeroClipboard.as(209): col: 21 Error: Call to a possibly undefined method CoreFont.
    Plus about 12 more error messages about the fonts/colours etc. I guess CoreFonts are something separate too? If so where do I get them?

    Seems similar to this: http://www.datatables.net/forums/discussion/20837/errors-while-compiling-zeroclipboardpdf-as-on-a-mac except I'm not on a Mac...

  • allanallan Posts: 61,933Questions: 1Answers: 10,154 Site admin
    Answer ✓

    I think the AlivePDF library I was using was 1.5 beta.

    The SWC file I was using is included in the TableTools package (github link). Perhaps try using that?

    Allan

  • chamanchaman Posts: 7Questions: 2Answers: 0

    Thank you Allen, that solved the issue.

This discussion has been closed.