If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : We have got a new blog where we post some interesting SWF internals info.
List of issues#1847 pdf frame exported is not same as displayed in browser or ffdex
Author: nissanjp
Date created:
Type: bug
Visibility: Everybody
Assigned to:
State: closed
> What steps will reproduce the problem?
pdf frame exported is not same as displayed in browser or ffdex
> What is the expected output? What do you see instead?
pdf frame exported is not same as displayed in browser or ffdex
> What version of the product are you using? Is it "nightly build"? Which operating system
do you have?
15.0.0. No. Windows 10
> Please provide any additional information below. If the problem is related to a SWF
file, attach it here, otherwise we can't help you.
0003.xml.swf (253 KiB)0003.xml.swf.pdf (543 KiB)
0003.zip (487 KiB)
2022-10-22_20-48-30.png (12 KiB)
I see your issue, no need to ask in other issues which leads to spam other users.
PDF issues, especially regarding fonts, are hard to solve.
This is why I still did not do any action about it.
I read every message in the tracker, but often, it is hard to solve so I do not respond
until I have the right mood.
It is not font issue. I deleted some image from xml, then convert to swf, so maybe some
picture caused wrong tags in pdf.
Though the pdf can be displayed in chrome etc. correctly.
So you exported the SWF file to XML format in FFDec,
then you removed an image from it,
then imported the XML back to the SWF file, correct?
Could you attach the modified XML file here?
I assume the file you attached at the beggining is original - unmodified file, correct?
I used swfmill to convert swf to xml, then remove picture, then convert new xml without
image back to swf, then use ffdec to convert to pdf. I found that there is same problem
for swf both before and after removed image.
So, may be it is not related to image.
Only need a way to be compatible with Adobe tags etc.
Not sure whether there is any method to use same way as chrome etc. to generate pdf.
0003.swf_original.xml (3,252 KiB)0003_original.swf (261 KiB)
Okay, it seems that you sent the original XML exported and the SWF file.
What I need now is your MODIFIED XML file - with the removed image or whathever changes
you did.
Because I tried to comment out DefineBitsJPEG3 objectID="85" myself and the PDF result was
okay to me. (Did not produce the error message)
How did you convert to pdf?
Check attachment for the pdf exported from frame. There is error when using adobe to open
it.
frames.pdf (663 KiB)
I took your 0003.swf_original.xml and commented out the tag DefineBitsJPEG3 objectID="85"
- see attachment modified.xml, then run
swfmill.exe xml2swf modified.xml modified.swf
(swfmill version 0.3.6)
modified.swf is in attachment too.
Then I opened the modified.swf file in FFDec, right click "frames" section in the tree on
the left and selected "export selection". In the new window I selected Frames: PDF. Then
selected a directory and then there was frames\frames.pdf. (see attachment)
I can open that file in Adobe reader without problems. It has red rectangle instead of the
image but this is caused because it needs to remove the shape holding it, not just image.
On the other side - I still cannot open your PDF which you attached - it has the Adobe
message - how did you export this?
Are we using the same FFDec version?
You said you use 15.0.0, I tried it with exactly the same and still can properly export.
Maybe you are using an outdated nightly?
I tried all versions, same error. Including your new nightly.
I export the frame in the same way as your way above.
I tried all versions, same error. Including your new nightly.
I export the frame in the same way as your way above.
I tried to export pdf with your modified.swf, same error occurs on the exported
frame.pdf.
I used ffdec_15.1.1_nightly2031.
Is it related to any flash environment? I installed a Chinese flash environment.
Could you send me PDF exported by you from my modified.swf file?
I'll try to compare them...
what is your flash envionment or plugin? Where to download your flash plugin to try and
test?
I don't have a flash plugin - only external flash projector,
but these do not have any relation to the PDF problem.
I will let you know when I figure out something...
Ok. I am using win10, Chinese version.
Where to download your flash projector?
I want to replace my below projector and then test.
flashplayer_sa.exe
flashplayer_sa_debug.exe
flash projector has nothing to do with the PDF export,
it is used for different kind of things, totally NOT the PDF export.
I did a little change to PDF generator,
please try nightly version 2035 or later.
I don't know whether it helps or not,
it's just an idea that might help or not.
Let me know if it's better - and attach newly generated PDF file from my modified.swf here
again.
I did second little change, available in nightly 2037 or later.
It works. Now there is no error for all pdf.
By the way, how to convert many pages together to a pdf, to reduce pdf size for all pages
by combining them to one font.
And the export process with command line is slow, how to accelerate it? Can I use java
directly to generate pdf?
Ad "how to convert many pages together to a pdf"
When you export a single SWF file which has for example 10 frames and 1 DefineFont2 tag
shared across texts on these frames, then on PDF export, only that 1 PDF font is stored
inside PDF which is shared across pages.
The problem is when you have 1 page = 1 SWF file and you want to merge multiple SWF/PDF
files into one.
I cannot help you with this, since it is a lot of manual work to merge SWF files (and make
them use single Font) and I do not know how to achieve that.
Ad "export process with command line is slow"
In my opinion - doing that by directly calling FFDec library for generating PDF won't make
any speedup.
Exporting in the GUI of FFDec should be the same speed (not counting SWF parsing when you
open it).
The SWF files you attached also contain fonts with many chinese characters, these all are
exported,
so these might be reason of slowness, but I don't really know.
I don't plan to optimize speed of the PDF export.
I prefer quality of the result over speed.
State: new→upgraded
If I combine all swf into one single swf with swfcombine.exe, then export frames to one
pdf.
Will the file size be small to share the fonts?
I don't know how swfcombine works, that's a question for somebody else.
I guess it just takes all the content including fonts from one SWF file and attaches it to
second SWF file,
it won't merge the fonts.
Just try it - if it results in the SWF where there are twice as many fonts in the fonts
treeview in FFDec,
then it does not merge and you will have then large PDF with many (repeating) fonts. But
that's not a task for FFDec since FFDec only exports texts with fonts that are associated
to them in the SWF file.
I won't help you with other programs than FFDec, sorry. I also can't help you with any
merging of such SWF files. FFDec is not designed to do that.
Ok. Thanks. Will try later.
To the original problem with the pdf:
there was problem with one shape - DefineShape3 (id 4)
because that shape was pure horizontal - it's height is zero
(it has only stroke, no fill).
That was major problem here.
And because you have Java 8 installed and I have Java9+,
these behaved differently when calculating affine transformations,
tha'ts why it worked for me and not for you.
Since nightly 2039, the horizontal shape should be properly displayed and also exported to
PDF.
I nightlys before this, there was no horizontal line under the title of the page.
I am closing this issue, since it seems to be solved.
Please create new issue if you want to report any new bug.
State: upgraded→closed