const pdfjsLib = require('pdfjs-dist/legacy/build/pdf.js');

async function extractText() {
  const data = new Uint8Array(require('fs').readFileSync('./public/resume-template.pdf'));
  const pdf = await pdfjsLib.getDocument({ data }).promise;
  
  console.log('Total pages:', pdf.numPages);
  
  for (let i = 1; i <= pdf.numPages; i++) {
    const page = await pdf.getPage(i);
    const content = await page.getTextContent();
    console.log(`\n=== Page ${i} ===`);
    console.log(content.items.map(item => item.str).join(' '));
  }
}

extractText().catch(console.error);
