SSRS only lets you create 1 PDF Per Report Execution.
So if your report returns 40,000 Pages, It will still only export 1 PDF File.
You can create a report that takes the record in you want, and export the pdf for that 1 record, and run it 40,000 times.
to get it to run 40,000 times you can create a service or winapp that gets a list of all 40000 records and loops thru the recordset calling the report for each ID.
You can perhaps Create the 1 PDF with 40,000 pages and automate someother program to create 1 PDF file per page.