Please don't conflate unit testing (UT), which is a tool, with test-driven design (TDD), which is a methodology. see this for more
Also, remember that one of the benefits of unit tests is for regression testing, i.e. as insurance against future breaking changes (and to help verify that fixed bugs do not become un-fixed).
In your first example, I would unit-test the PDF conversion as follows:
- start with a known set of sample data, and generate the PDF document
- manually verify that the generated PDF is correct
- retain the sample data and correct PDF document as part of the test suite
- write a function to compare two PDF documents for differences (at the binary or content level, as appropriate)
- automate this unit test to compare the PDF document generated from the sample data with the verified-correct document from the first step
Now, whenever you change the PDF generation code, you have an automated unit test to verify that you did not break document generation at least for the sample data and output format.
I have used the same technique for verifying HTML-rendered pages, GUI screens, etc. Manually verify the baseline, then automate the comparison after that. This provides insurance against future breaking changes.
Of course if your output formats change frequently this may not be as useful, but a baseline test of the basic output formatting is likely to have a long lifespan.
In your second example it sounds like you would be testing the 3rd-party ORM tool, which is probably pointless. However, again some baseline tests may be useful as insurance against future breaking changes, depending on how you are using the tool. For example, instead of mocking up the entire n-tier chain (I'm not a fan of mocking when it is not necessary), just use the ORM tool to create, read, update, and delete a typical object/record, and verify the operation using direct SQL statements on the (test) database. That way if the 3rd-party vendor later updates something that breaks the basic functionality you'll know about it, and new developers to your project can easily see how to use the ORM tool from the unit test examples.