How to Fix Incorrect URL Paths When Converting Web Pages to PDF
Question details
The user needs to fix broken links and incorrect URL paths generated when converting HTML web pages to PDF.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Converting web pages to PDF documents.
- Observed behavior
- Relative HTML links are resolved against the wrong base URL, resulting in broken or incorrect hyperlinks in the output PDF.
Ensure you have access to the original HTML source code of the web page and check if the website requires authentication to view.
Update HTML Links to Absolute URLs
Modify the source HTML to use absolute URLs instead of relative paths to ensure the converter resolves the links correctly.
PDF converters often struggle with relative URLs because they lack the context of the website's root directory. Changing these to absolute URLs ensures the exact destination is hardcoded into the document.
Open the original web page source code or the HTML file you are trying to convert using a text editor or code editor.
Find the anchor tags (<a>) containing the relative paths, for example: href="/about-us".
Update the href attributes to include the full domain path, such as href="https://www.example.com/about-us".
Save the HTML file and attempt the conversion to PDF again to verify the hyperlinks function correctly.

Define a Base URL in the HTML Head
Add a base tag to the HTML header to force PDF converters to resolve relative links against a specific domain.
Update and Configure PDF Converter Settings
Ensure your PDF software is up to date and configured to capture web links correctly.
Edit and Fix PDF Links with WPS Office
If your converted PDF already contains broken links, you can easily edit, correct, or add new hyperlinks directly within the document using WPS PDF without having to reconvert the original HTML.
- 1. Open the PDF: Launch WPS Office and open your converted PDF file in the WPS PDF editor.
- 2. Access the Edit Tool: Click on the 'Edit' tab in the top ribbon menu and select the 'Link' tool.
- 3. Modify the Broken Link: Click on the broken hyperlink in your document. A link properties window will appear.
- 4. Update the URL: Enter the correct absolute URL in the web address field and click 'OK' to save the working link.

Frequently Asked Questions
Why do relative links break when converting HTML to PDF?
Relative links depend on the root directory or base URL of the hosting server. When converted locally or without a base URL reference, the PDF converter cannot determine the correct domain, resulting in a broken file path.
Can I manually fix broken links after the PDF is already created?
Yes. You can use PDF editing software like WPS PDF. Navigate to the Edit menu, select the Link tool, and manually update the hyperlink addresses to the correct web URLs without needing to recreate the document.
What is an absolute URL compared to a relative URL?
An absolute URL includes the complete path to a resource, starting with the protocol and domain name (e.g., https://www.example.com/page). A relative URL only includes the path following the domain (e.g., /page) and relies on the browser to fill in the rest.
Does WPS Office support converting web pages to PDF?
Yes, WPS Office offers comprehensive PDF tools, allowing you to convert various file types to PDF, as well as seamlessly edit the resulting documents, including text, images, and hyperlinks.




