Clinic Profile & Document Manager
Set up your clinic's identity once — then generate professional visiting cards and case paper letterheads in PDF or image format, with your logo, vets' degrees, signatures, working hours, and services automatically included.
Overview
The Clinic Profile & Document Manager is a Director-only tool that lets you maintain a single source of truth for your clinic's contact details, branding, and staff information. That data is then used to automatically populate two types of printable documents: a Visiting Card and a Case Paper letterhead.
You can also upload your own pre-printed casepaper design (as an image or PDF) and set it as the default so it is served when staff request a case paper download.
One-time setup
Fill in the clinic profile once. All generated documents pull from this profile automatically — update the profile to update all future documents.
Visiting Card
Standard 3.5" × 2" business card layout with clinic name, address, contact details, services summary, working hours, and optional vet name.
Case Paper / Letterhead
A4 portrait letterhead with header, watermark, authorized signature area, and a footer with contact details and working hours.
Custom Casepaper Upload
Upload your own printed casepaper as JPG, PNG, or PDF. Set it as the default to serve it in place of the generated template.
Vet Signatures
Upload a signature image for each veterinarian. Signatures appear on generated case papers in the authorized-signature section.
PDF & Image download
Every document can be downloaded as a print-ready PDF or as a high-quality JPG image file.
Access & Permissions
The entire Clinic Profile page is restricted to users with the clinic_director role. All AJAX endpoints additionally check for the manage_clinic_users capability before processing any request.
Non-directors who visit the page see an "Access denied. Directors only." message and cannot interact with any form or document generator.
Each director has a completely separate clinic profile. One director cannot view or modify another director's profile — all data is scoped by director_id.
Shortcode
Place the following shortcode on any page to embed the Clinic Profile dashboard:
The page will render both the Clinic Profile form and the Generate Documents section together. Scripts and styles are only enqueued on pages that contain this shortcode.
Basic Information
When the page loads, the existing saved profile is automatically fetched and pre-fills all form fields. If no profile exists yet, all fields are blank.
| Field | Required? | Notes |
|---|---|---|
| Clinic Name | Required | Shown prominently on all generated documents |
| Address | Required | Full street address; shown in document headers and visiting card |
| City | Optional | Shown alongside State and Pincode |
| State | Optional | |
| Pincode | Optional | |
| Phone | Optional | Landline number; shown in document footer and visiting card |
| Mobile | Required | Also used as the emergency contact in the case paper footer |
| Required | Shown in footer and visiting card contact info | |
| Website | Optional | Shown in footer and visiting card if provided |
Clinic Logo
The logo appears in the top-left of the case paper header, on the visiting card, and as a faint watermark in the centre of the case paper body.
Click "Select Logo"
A file browser opens. Select any image file (JPG, PNG, GIF — max 2 MB).
Preview appears
The selected image is shown in the 100×100 px preview box. A "Remove Logo" button appears to clear the selection before saving.
Save Profile
The logo is uploaded as a base64-encoded file when you click Save Profile. The server decodes it, saves it to the WordPress uploads folder, and stores the file URL in the profile. The previous logo file is automatically deleted when a new one is saved.
Accepted formats: JPG, JPEG, PNG, GIF, WebP. Maximum file size: 2 MB. Files outside these constraints will be rejected.
If you save the profile without selecting a new logo, the existing logo URL is preserved. Choosing "Remove Logo" and saving will clear the logo from the profile entirely.
Working Hours
There is one text field for each day of the week: Monday through Sunday. Enter the hours in any format you prefer (e.g. 9:00 AM – 6:00 PM or Closed). Leave a day's field blank if the clinic is not open that day — blank days are omitted from documents.
When displayed on generated documents, consecutive days with identical hours are automatically grouped. For example, if Monday–Friday all have 9:00 AM – 6:00 PM, the document shows Mon–Fri: 9:00 AM – 6:00 PM rather than listing each day separately. The footer displays up to 8 hour groups across two rows of 4.
The visiting card uses a compact single-line summary (e.g. Mon–Fri: 9 AM–6 PM; Sat: 10 AM–2 PM) while the case paper footer shows the full grouped grid. Both are generated automatically from the same stored data.
Services Available
Enter the services your clinic offers in the large text area. Each service should be on its own line (a newline acts as a separator). On generated documents:
- The case paper header tagline shows the first 3 services joined with " • " (e.g. Vaccination • Surgery • Dental Care). If no services are entered, it shows "Complete Veterinary Care" as a fallback.
- The visiting card shows the first 3 services in the same bullet-separated format in the lower services section.
Veterinarians & Degrees
This section lets you associate degrees and signatures with specific veterinarians registered under your clinic. The vet list is pulled from WordPress users who have the clinic_veterinarian role and whose clinic_director_id user meta matches your director ID.
Selecting Veterinarians
A multi-select list shows all your registered veterinarians. Hold Ctrl (or Cmd on Mac) to select multiple. When you select a vet, a degree/signature entry panel appears dynamically for each selected vet. Deselecting a vet removes their panel.
Per-vet Fields
| Field | Required? | Notes |
|---|---|---|
| Degree / Qualification | Optional | e.g. "BVSc, MVSc, PhD" — shown in brackets after the vet's name on documents |
| Signature Image | Optional | JPG or PNG, max 500 KB. Shown in the authorized-signature section of the case paper. |
If no veterinarians appear in the list, the selector shows "No veterinarians found. Add veterinarians first in User Management." You need to create user accounts with the clinic_veterinarian role and link them to your director before they appear here.
Vet Signatures
Each selected vet has a "Signature Image" file input. Select a JPG or PNG file (max 500 KB). A small preview of the signature appears below the input after selection. The signature is stored as a base64 data URL in the profile.
Signature handling on save is smart: if you save the profile without uploading a new signature for a vet, the previously saved signature is preserved. Signatures are only overwritten when a non-empty new file is submitted. Signatures for vets who are deselected are automatically removed from the stored data.
Signature on Case Papers
When generating a case paper with a specific vet selected, that vet's signature image appears above the "Authorized Signature" line in the bottom-right of the letterhead. If no specific vet is selected, the first available signature in the saved profile is used. If no signatures are saved at all, only the signature line and label are shown (no image).
Signature images are stored as base64 strings in the database. Keep signature files small (under 500 KB) to avoid bloating the database row. A clean transparent-background PNG export is ideal.
Saving the Profile
Click the Save Profile button at the bottom of the form. The system checks whether a profile already exists for your director ID:
- If no profile exists — a new row is created and you see "Profile created successfully."
- If a profile exists — the existing row is updated and you see "Profile updated successfully."
A green success banner appears at the top of the form section. If there is a validation error (missing required field) or a database error, a red error banner appears instead.
You must save the profile at least once before uploading custom casepapers. The casepaper upload endpoint updates the profile row — if no row exists yet, the upload will succeed at the file-system level but fail to persist in the database.
Visiting Card
The Visiting Card generator produces a standard 3.5" × 2" business card layout populated with your clinic profile data.
Vet Selection
A dropdown above the generate buttons lets you choose a specific veterinarian or leave it as "Generic (No specific vet)". When a vet is selected:
- Their name is shown as Dr. [Name] ([Degree]) below the logo (if a logo is present) or below the clinic name (if no logo)
- The degree is only shown if a degree was saved for that vet
Visiting Card Content
(if set)
Dr. Name
(Degree)
Email: clinic@example.com
Hours: Mon–Fri: 9 AM–6 PM; Sat: 10 AM–2 PM
Services: Vaccination • Surgery • Dental Care
Generate Buttons
Case Paper / Letterhead
The Case Paper generates an A4 portrait letterhead intended for printing and use as physical case paper. It has the same vet selection dropdown and the same three output buttons as the visiting card.
Default Casepaper Logic
When you click to generate a case paper, the system first checks your default casepaper setting:
- If the default is set to "Uploaded" and a valid uploaded file exists at that index → the uploaded file is served directly (PDF streamed inline, image streamed inline)
- If the default is set to "Template", or the uploaded file is missing → the generated HTML letterhead template is used
The vet selection dropdown only affects the generated template. If your default is an uploaded casepaper, the vet selection is ignored and the uploaded file is served as-is.
Letterhead Layout
The generated letterhead is divided into three zones:
📞 Mobile
Watermark logo centred at 8% opacity →
Available 24/7 for emergencies
Header Zone (top ~10% of page)
White background with a dark navy bottom border. Left side contains the logo (if set) and clinic name, with the selected vet's name and degree on the next line, then a tagline of the first 3 services. Right side shows the address, city/state/pincode, mobile, and email.
Body Zone (middle ~82% of page)
Blank white writing area intended for handwritten or typed case notes. If a logo is saved, it is rendered as a centred watermark at 8% opacity. The authorized signature block sits in the bottom-right of this zone, positioned absolutely at 12% from the bottom.
Authorized Signature Block
Positioned in the lower-right of the body area. Contains the vet's signature image (if uploaded), a horizontal signature line, the label "Authorized Signature", and the vet's name prefixed with "Dr." (if a vet was selected). If no vet is selected but signatures exist, the first saved signature is used.
Footer Zone (bottom ~8% of page)
Dark navy background, white text. Three columns:
- Left: Phone (or mobile if phone is blank), email, website
- Centre: "Working Hours" heading and the grouped hours grid (up to 2 rows of 4 groups)
- Right: Emergency number (mobile) and "Available 24/7 for emergencies"
Output Formats
Both the Visiting Card and the Case Paper support three output options:
| Button | What opens | How to save |
|---|---|---|
| 👁 Preview | A modal overlay within the page showing the document HTML | Visual check only — no file is saved |
| ⬇️ Download PDF | A new browser tab/window with the document HTML and a "🖨️ Print / Save as PDF" button at the top | Click the Print button → in the print dialog, select "Save as PDF" or "Microsoft Print to PDF" as the destination printer |
| 🖼️ Download Image | A new browser tab/window with a dark control bar and the document rendered below it | Click "💾 Download as JPG" — the browser captures the HTML via html2canvas and triggers a JPG download automatically |
Image Dimensions
| Document | Image size | Orientation |
|---|---|---|
| Case Paper | 1240 × 1754 px (approx. A4 at 150 DPI) | Portrait |
| Visiting Card | 1050 × 600 px (3.5" × 2" at 300 DPI) | Landscape |
The image download uses html2canvas at 2× scale internally for sharpness, then scales the result to fit the target canvas while maintaining aspect ratio and centring the content on a white background.
The PDF output is browser-print based, not server-side PDF generation. The quality and layout may vary slightly between browsers. Chrome and Edge generally produce the most consistent results. For best output, use "Save as PDF" in the print dialog with "Background graphics" enabled.
Upload Your Own Casepaper
If your clinic uses a pre-printed or custom-designed casepaper, you can upload it so it is served when staff generate a case paper download. This is useful when your design is more complex than the built-in template.
Click "📂 Choose File"
A file browser opens. Select a JPG, PNG, or PDF file (max 5 MB).
Filename appears
The chosen filename is shown next to the button and the "⬆ Upload" button becomes visible.
Click "⬆ Upload"
The file is uploaded to the WordPress uploads folder. The uploaded casepapers list refreshes to show all uploaded files for your clinic. Each entry shows the filename, file type (image or PDF), and upload date.
Uploaded Casepapers List
After uploading, the list below the upload area shows all uploaded casepapers for your clinic. Each entry shows the filename, type badge, and upload date. Files are stored under a key of casepaper-{director_id}-{timestamp}.{ext} in the uploads directory. The full list is stored as a JSON array in the casepaper_uploads column of your profile row.
You must save your clinic profile at least once before uploading casepapers. The upload handler updates your profile row in the database — if no row exists, the file will be saved to disk but the record will not be stored.
Set Default Casepaper
The "⭐ Set Default Casepaper" panel lets you choose which casepaper is used when someone clicks "Generate Case Paper". The options are populated dynamically from your saved uploads plus the built-in template.
| Option | What it does |
|---|---|
| 📄 Template (built-in) | Uses the generated HTML letterhead with your clinic profile data. The vet selector and format (PDF/image) choices are respected. |
| 📎 Uploaded file [N] | Serves the chosen uploaded file directly — PDF is streamed as inline PDF, images are streamed with their original MIME type. Vet selection is ignored. |
Select the radio button for your preferred option and click "💾 Save Default". A green "✔ Saved!" confirmation appears inline. The default setting persists across sessions.
If you delete an uploaded casepaper that is currently set as the default, the system automatically resets the default back to "Template" so document generation does not break.
Delete Uploaded Casepapers
Each entry in the uploaded casepapers list has a delete button. Clicking it removes both the physical file from the server and the entry from the JSON list in your profile row.
Index adjustment is handled automatically: if you delete an entry that is not the default, the default index is decremented if needed so it still points to the correct file. If you delete the currently-selected default upload, the default is reset to "Template".
Deletion is permanent. The physical file is removed from the uploads directory with unlink() and cannot be recovered. Download a copy before deleting if you may need it again.
FAQ
No. The shortcode renderer checks for the clinic_director role and returns an "Access denied. Directors only." message for all other users. The AJAX endpoints also check the manage_clinic_users capability and reject requests from users who don't have it.
No. All database queries are scoped by director_id = get_current_user_id(). Each director can only read and write their own profile row. The table has a unique key on director_id, so each director can have at most one profile.
The vet list fetches WordPress users who have the clinic_veterinarian role AND have a clinic_director_id user meta value that matches your director user ID. If vets are missing, check that: (1) their WordPress role is set to clinic_veterinarian, and (2) their clinic_director_id user meta is set to your user ID in the User Management section.
Signatures are preserved on save if the vet is still selected in the vet list. If you accidentally deselected a vet before saving, their signature is removed because the system removes signatures for vets not in the current selection. Re-select the vet, re-upload their signature, and save again.
If the default is set to "Uploaded" but the physical file is not found on the server (e.g. it was manually deleted from the uploads folder), the system falls through and generates the built-in HTML template instead. No error is shown to the user.
Yes. The PDF is generated using the browser's built-in print function, so layout rendering varies by browser. Chrome and Chromium-based browsers (Edge, Brave) generally produce the most faithful output. If consistency is critical, use the image download option instead, which uses html2canvas to capture the layout at a fixed pixel size regardless of browser.
Yes. There is no hard limit on the number of uploaded casepapers. Each upload is appended to the JSON array in your profile. You can then choose which one to set as the default. Only one casepaper can be the default at a time.
Use the "Select Veterinarian" dropdown in the Visiting Card section and choose the vet before clicking Preview or Download. The selected vet's name (and degree if saved) will appear on the card. The dropdown is populated from the same vets linked to your director.
All files are saved in WordPress's standard media uploads directory (the same folder used by the WordPress media library, organised by year/month). Logo files are named clinic-logo-{director_id}-{timestamp}.{ext} and casepaper files are named casepaper-{director_id}-{timestamp}.{ext}. The URLs are stored in the profile database row.
Yes. When you save a profile with a new logo, the server reads the existing logo URL from the database, derives the file path, and deletes the old file with unlink() before saving the new one. This only applies to logos that contain "clinic-logo-" in their filename (i.e. logos uploaded through this plugin).
Other clinic modules (such as Indoor Patient Management and Certificate Management) use their own TCPDF-based PDF generation and reference the clinic profile independently via Vet_Clinic_Profile_Manager::get_clinic_profile(). The letterhead generated here is a standalone printable document, not a shared background asset for other modules.