To extract a PDF table to CSV offline on a Mac, use Preview to check that the table text is readable, then give a local model one page or table at a time. Import the resulting CSV into Numbers and compare its cells with the PDF, including empty cells, before using it in another spreadsheet.

Define the rows and columns before extracting them

Open the original PDF in Preview. Find one table and write down its page, column headings, and the row range you need. If the PDF displays printed page labels that differ from its order in Preview, use the order in Preview for your review notes and record the printed label alongside it. Choose a row identifier that appears in the source and stays stable while you compare the two files. That could be a product code, device label, or record number. If the source can repeat that identifier, track its page and position too.

Decide which columns should end up in the CSV. A table may carry several levels of headings, such as a group called “Inspection” followed by columns for date and outcome. Give those final columns distinct names and keep units in the header or in their own column. Treat rows labeled “Total” or “Continued” according to their role in the original. Counting a subtotal as another shipment would inflate the derived total even if every value was copied accurately.

Try selecting and copying two adjacent rows into a temporary plain-text document. Include a row with an empty cell or a longer description. The copied text should give you enough information to match each value to its column. If it runs values together or moves a wrapped description onto a separate row, open the source and reconstruct that passage as a small excerpt with labeled fields. A scanned page may need a readable text layer first. Open the processed copy and compare a few characters, decimals, and row breaks with the scan before asking the model about it. Apple’s guide to selecting text in Preview · Make a scanned PDF searchable on Mac

Create a small PDF with a known answer

Use a harmless four-row inventory before trying a real report. In Numbers, create a blank spreadsheet and enter the five rows below as four table columns. The pipe characters show the column boundaries. Leave the last cell of the second item empty. Export the sheet using File > Export To > PDF and name the copy workshop-items.pdf. Reopen it in Preview and confirm that the full table fits on a single PDF page and all four rows are visible. The worksheet remains the answer key. Apple’s Numbers export guide

Item ID | Description          | Quantity | Inspection code
M-301   | Seal, blue           | 2        | C4
M-302   | Filter pad           | 12       |
M-303   | Quoted "short" clamp | 7        | B9
M-304   | Seal, blue           | 0        | A2

The test has several deliberate details. The two “Seal, blue” rows share a description and represent separate items with different identifiers. The zero on the last row is a recorded quantity. The blank inspection code on the second row indicates an empty cell. The comma and quote marks belong to their descriptions. A trial passes when all four data rows remain in order and every cell matches these expected values.

LM Studio supports PDF attachments to a local chat after the required assets are downloaded. Open a fresh chat with the downloaded model selected. For an offline trial, disconnect the network before attaching the practice file and asking the question. Attach only this PDF so you can tell where the answer came from. If you are setting up LM Studio for the first time, complete a short local chat before testing documents. LM Studio document attachments · LM Studio offline operation · Set up a local LM Studio chat

Ask for one consistent CSV

Give the model the intended header, source page, and row handling. Use an extraction prompt like the one below. For a real PDF, replace the sample identifiers and fields with the actual table boundary. If the PDF attachment contains other tables, include its visible table caption and begin with just the relevant rows. A known row range will let you reconcile any entries that disappear.

Use only the four inventory rows on PDF page 1 in workshop-items.pdf.
Return CSV with this header:
item_id,description,quantity,inspection_code,source_pdf_page
Copy one record per item ID in the order shown.
Preserve descriptions, quotes, punctuation, and zero quantities.
Leave an empty inspection code as an empty CSV field.
Use standard CSV quoting for fields containing commas or double quotes.
Use 1 in source_pdf_page for each row.
If you cannot align a row with the columns, list its ID and explain
the ambiguity separately from the CSV.

Open the reply and check whether it includes the header once and four records. In a comma-delimited CSV, a description containing a comma needs enclosing double quotes. A double quote inside a quoted description is written as two consecutive double quotes. Without that escaping, a spreadsheet can shift a quantity into the inspection column or split the record. Here is the expected CSV for the exercise.

item_id,description,quantity,inspection_code,source_pdf_page
M-301,"Seal, blue",2,C4,1
M-302,Filter pad,12,,1
M-303,"Quoted ""short"" clamp",7,B9,1
M-304,"Seal, blue",0,A2,1

Copy only the header and data lines into a new TextEdit document in plain-text mode. Save it with a distinct name ending in .csv and confirm the full name in Finder. Put any discussion of uncertain rows in a separate review note so those lines stay out of the spreadsheet import. Keep the original PDF beside the working files so you can return to the exact page. Apple’s TextEdit format guide

Import the file and check the actual cells

Open the CSV in Numbers. Inspect the import settings if the rows appear in one column or split at the wrong character. Use comma as the delimiter and a double quote as the text qualifier for this sample. Decimal separators and separators inside descriptions matter when a file from another locale uses a different format. If your destination expects comma-delimited text, inspect the result in the destination program as well. Apple’s Numbers text import guide

Begin with a structural check. The table should have five columns and four data rows under one header. The repeated description should appear twice in the same column. The two quotes around “short” should appear as ordinary characters in one cell. On the second row you should see an empty inspection cell with the page value still in the final column. Compare the last record with the PDF so the zero remains a value. If a table contains codes with leading zeros, check how the destination displays and stores them. A spreadsheet can interpret a numeric-looking identifier as a number. Keep those identifiers as text where the destination allows it, then check the raw CSV and the imported cells.

Next compare the rows in Preview with the cells you plan to use. For the sample, confirm all four identifiers in order and compare each quantity and code. The quantity column should sum to 21. The total catches some missing or misread numbers. It can also stay correct when two quantities are swapped, which makes the comparison by row identifier necessary. Use the sum and the row check together for quantity tables. When the real file has values in more than one unit, check each unit group independently.

If the CSV is going to someone who did not extract it, include the original page span or a small review note with the verified rows. This gives the recipient a way to resolve a question without relying on the prompt history. Keep the raw draft output separate from the version you inspected. A name like workshop-items-reviewed.csv is useful when another copy of the CSV was produced during troubleshooting.

For real numeric columns, choose a consistent representation before merging pages. Downloaded statements and inventory reports can show a minus sign, parentheses for a negative value, or decimal commas. Write down the notation used by the source and the representation accepted by the destination. Check one negative value and one value with a fractional part on import. If the source includes a unit or a text suffix, inspect the quantity and suffix together before using the numeric column in a formula.

Recover a row the model missed or shifted

If two rows have been combined, locate both identifiers in Preview and compare where the long description wraps. Retry only that pair with the same table headings. When the PDF text selection mixes unrelated columns, build a short plain-text excerpt from the visible page with one line per row. Give each field a label and put an explicit marker beside an empty source cell. Ask the model to convert that scoped excerpt, then compare the returned record with the original page. A manual transcription of a single uncertain row can also be faster than another complete extraction.

Long attachments can use retrieval to find passages relevant to the prompt. A selected passage can contain an item without its headers or a group of rows without the surrounding table. Send a smaller page range or focused excerpt when you need exhaustive coverage. Keep repeated PDF headers out of the data rows and record their column order for each page. If the layout switches from a four-column table to three columns, import the sections independently and reconcile the schemas before combining their records. LM Studio’s explanation of document context and retrieval

For several pages with the same layout, start a new worksheet or temporary file for each page. Record each page’s first and last identifier, row count, and expected header. When a row spans the bottom of one page and the top of the next, join the continuation after confirming it belongs to the preceding record. Before combining the pages, compare the sum of the verified row counts with the number of rows in the combined table. Check the first and last row from every page to catch a missing boundary record or an extra header.

Finish by checking the result against the scope from the start of the job. Every source row you included should have a corresponding verified record or an explanation in the review note. Read the first and last record after opening the final CSV again, and confirm that the intended app can use it. For the next PDF with the same layout, reuse the field definitions and review checks with that file’s own page and row ranges.