Thank you for your post.
Our Development and Testing departments are aware this issue has been reported, but they have been unable to replicate the issue. Therefore, they would like to get a copy of your database file so they can understand why this error is occurring. Check your Inbox at the top of this page for instructions where to send a copy of your file.
Just a thought: Do you get the same result if you set up the portal and all its elements and give them a Hide object when setting that hides them when the portal will be empty?
That just might serve as a work around if it works...
That happens to work, quite excellent, learn that from years of experience I suppose? lol. But I didn't need to do it to all elements in the portal luckily. Just the first element which if any information will be inputted, the first element will definitely have data in it. That first element is Indexed as well, and the others aren't, but I tested setting some to index and it seems to still be ok PDFs.
So the solution was
Select portal > Go to behavior in inspector > Hide object when > Is empty ( portal/table name::field name )
PhilModJunk, just incase I come across a issue for some reason where it needs all elements to go through the hide object situation. Is the most effective coding setting each one the same way above?
Thank you for finding a what I would call is a "solution!" instead of "work around".
The best field to test is the portal table's match field as defined in the relationship. If that reference comes up empty, you are quite sure to not have any related records.
Another variable not documented here is whether an empty portal that is filtered and the filter produces an empty portal also produces the same result. (In other words, there are related records, but none that pass the portal's filter.)
BTW, there are two reports here of the same issue.
For More Information see: PDF Corrupted
This is one of many acknowledged bugs that can be found in the Known Bug List thread here in the Report an Issue section of the forum.
It can also be downloaded as a database file from: https://www.dropbox.com/s/jt09b82i0xijbu3/FMP%20Bugs.zip
I had the same problem with an empty container field causing corrupt PDFs. The work-around is the same...set the container to Hide when empty resolves the issue.
This issue has been addressed in FileMaker Pro 15.