function pairing_scheme_generate_featured_image($subject, $badge, $year, $outPath, $keywords = 'MCQs   ·   Short & Long Questions   ·   Marks Distribution   ·   Exam Pattern') {
    $SCALE = 2;
    $W = 1200 * $SCALE; $H = 630 * $SCALE;
    $img = imagecreatetruecolor($W, $H);
    imageantialias($img, true);
    $white = imagecolorallocate($img, 255, 255, 255);
    $blue = imagecolorallocate($img, 11, 74, 130);
    $orange = imagecolorallocate($img, 232, 87, 31);
    $gray = imagecolorallocate($img, 107, 114, 128);
    $lightBlue = imagecolorallocate($img, 196, 216, 235);
    imagefilledrectangle($img, 0, 0, $W, $H, $white);

    $fontBold = '/usr/share/fonts/urw-base35/NimbusSans-Bold.otf';
    $fontReg = '/usr/share/fonts/urw-base35/NimbusSans-Regular.otf';
    $s = function ($v) use ($SCALE) { return $v * $SCALE; };

    $cx = $s(1015); $cy = $s(150);
    imagesetthickness($img, $s(3));
    imageellipse($img, $cx, $cy, $s(160), $s(300), $lightBlue);
    imageellipse($img, $cx, $cy, $s(300), $s(160), $lightBlue);
    imagefilledellipse($img, $cx, $cy, $s(20), $s(20), $lightBlue);

    imagettftext($img, $s(34), 0, $s(62), $s(88), $blue, $fontBold, 'Freebooks.pk');
    imagettftext($img, $s(15), 0, $s(64), $s(118), $gray, $fontReg, 'Pairing Schemes · Past Papers · Study Resources');

    imagefilledrectangle($img, $s(62), $s(148), $s(68), $s(468), $orange);

    $badgeFontSize = $s(18);
    $bbox = imagettfbbox($badgeFontSize, 0, $fontBold, $badge);
    $bw = $bbox[2] - $bbox[0];
    $bh = $bbox[1] - $bbox[7];
    $padX = $s(22); $padY = $s(14);
    $pillX0 = $s(96); $pillY0 = $s(172);
    $pillX1 = $pillX0 + $bw + $padX * 2; $pillY1 = $pillY0 + $bh + $padY * 2;
    $radius = ($pillY1 - $pillY0);
    imagefilledrectangle($img, (int)($pillX0 + $radius / 2), (int)$pillY0, (int)($pillX1 - $radius / 2), (int)$pillY1, $orange);
    imagefilledellipse($img, (int)($pillX0 + $radius / 2), (int)(($pillY0 + $pillY1) / 2), (int)$radius, (int)$radius, $orange);
    imagefilledellipse($img, (int)($pillX1 - $radius / 2), (int)(($pillY0 + $pillY1) / 2), (int)$radius, (int)$radius, $orange);
    imagettftext($img, $badgeFontSize, 0, (int)($pillX0 + $padX), (int)($pillY1 - $padY + $s(2)), $white, $fontBold, $badge);

    imagettftext($img, $s(19), 0, $s(96), (int)($pillY1 + $s(34)), $gray, $fontBold, 'PAIRING SCHEME ' . $year);

    imagettftext($img, $s(56), 0, $s(94), (int)($pillY1 + $s(90)), $blue, $fontBold, $subject);

    $poly = [0, $s(500), $W, $s(470), $W, $H, 0, $H];
    imagefilledpolygon($img, $poly, $blue);
    imagefilledrectangle($img, 0, $s(555), $W, $H, $orange);

    imagettftext($img, $s(15), 0, $s(92), $s(583), $white, $fontReg, $keywords);
    $fbBbox = imagettfbbox($s(19), 0, $fontBold, 'freebooks.pk');
    $fbW = $fbBbox[2] - $fbBbox[0];
    imagettftext($img, $s(19), 0, (int)($W - $s(92) - $fbW), $s(583), $white, $fontBold, 'freebooks.pk');

    $final = imagecreatetruecolor(1200, 630);
    imagecopyresampled($final, $img, 0, 0, 0, 0, 1200, 630, $W, $H);
    imagepng($final, $outPath, 6);
    imagedestroy($img);
    imagedestroy($final);
    return $outPath;
}
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//freebooks.pk/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://freebooks.pk/post-sitemap.xml</loc>
		<lastmod>2026-07-23T15:00:00+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://freebooks.pk/page-sitemap.xml</loc>
		<lastmod>2026-07-05T22:15:27+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://freebooks.pk/notes_chapter-sitemap.xml</loc>
		<lastmod>2026-07-22T08:00:00+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://freebooks.pk/category-sitemap.xml</loc>
		<lastmod>2026-07-23T10:28:45+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://freebooks.pk/notes_category-sitemap.xml</loc>
		<lastmod>2026-07-21T11:20:28+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->