You need to sign in to do that
Don't have an account?
Stripping <HTML> tags from APEX
Hi, a bit new to all of this,
I'm attempting to create a VisualForce page which literally writes a text file, with no HTML tags at all, for use with some legacy scripts we have in place that require this format. This is eventually going to be filled with some information from an accounts record, but I'm testing without at the moment
<apex:page sidebar="false" showheader="false">
<h1>Congratulations</h1>
</apex:page>
Unfortunately when viewed in a browser, this is adding the html around the outside
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head></head><h1>Congratulations</h1></html>
Is there any way in apex to suppress the automatic formatting with this html that gets added in?
Thanks in advance
use the contenttype parameter on the page tag.
Something like this:
<apex:page sidebar="false" showheader="false" contenttype="text/plain"> <h1>Congratulations</h1> </apex:page>
All Answers
use the contenttype parameter on the page tag.
Something like this:
<apex:page sidebar="false" showheader="false" contenttype="text/plain"> <h1>Congratulations</h1> </apex:page>
Thanks, that's perfect, I had to bring the < > in tight against each other or it added spaces as well
<apex:page sidebar="false" showheader="false" contenttype="text/plain"><h1>Congratulations</h1></apex:page>