Convert html to Dom object possible
Hi all,
my question is , can we convert a simple html to Dom object or not
Thanks in advance
That would print the code as a PDF, not the rendered page.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Ian Edwards" <[email protected]>
wrote in message
news:g0q95l$ego$[email protected]..
> Hi
>
> not sure really want you want to achieve but assuming
you have the full
> suite you have the full versiom of acrobat. This
installs a "pdf" creator
> as a printer so you can print your code to it by
selectig file--print code
> and then selecting the Adobe pdf printer, (if you have
flash paper you can
> print to that and then save as pdf)
>
> If you want the design view printed I think you will
have to preview in a
> browser andthen print as above.
>
> HTH
>
> Ian
>
> --
> [email protected]
>
http://www.edwards-micros.co.uk
>
Similar Messages
-
Converting DOM object tree to Swing Tree
I'm interested in converting a DOM object tree into a Swing TreeModel Tree.
What prominent utilities exist for converting DOM to Swing Models in Java 1 and/or Java 2
This seems to be a very general requirement. Please let me know if any utility code is provided for easing my task. Its Urgent !!The JAXM API does not supply a easy way to do this. I ended up writing a class to convert between a DOM and the SOAP Elements required by JAXM. Seems like a big oversite to me...
chuck -
Problem with converting html to pdf using LiveCycle ES Java API
I am using this code to convert html to pdf.
* 1. adobe-generatepdf-client.jar
* 2. adobe-livecycle-client.jar
* 3. adobe-usermanager-client.jar
* 4. adobe-utilities.jar
* 5. wlclient.jar
import java.io.File;
import java.util.Properties;
import com.adobe.idp.Document;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient;
import com.adobe.livecycle.generatepdf.client.HtmlToPdfResult;
public class ConvertHTML {
public static void main(String[] args)
try{
//Set connection properties required to invoke LiveCycle ES
Properties connectionProps = new Properties();
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "t3://localhost:7001");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebLogic");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
//Create a ServiceClientFactory instance
ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
//Create a GeneratePdfServiceClient object
GeneratePdfServiceClient pdfGenClient = new GeneratePdfServiceClient(factory);
//Get an HTML document to convert to a PDF document a
String inputFileName = "http://www.adobe.com";
//String inputFileName = "C:\\Documents and Settings\\venkat\\Desktop\\Adobe.htm";
String securitySettings = "No Security";
String fileTypeSettings = "Standard";
System.out.println("one");
//Convert HTML content to a PDF document
HtmlToPdfResult result = pdfGenClient.htmlToPDF2(inputFileName, fileTypeSettings, securitySettings, null, null);
System.out.println("two");
//Get the newly created document
Document createdDocument = result.getCreatedDocument();
//Save the PDF document as a PDF file
createdDocument.copyToFile(new File("C:\\test.pdf"));
catch (Exception e) {
System.out.println("Error OCCURRED: " + e.getMessage());
e.printStackTrace();
I can able to compile this class but while running i am getting error like below.
Error OCCURRED: Internal error.
ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
:160)
at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat
cher.java:57)
at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.htmlToPDF2(GeneratePdfSer
viceClient.java:666)
at ConvertHTML.main(ConvertHTML.java:84)
Caused by: java.rmi.RemoteException: Remote EJBObject lookup failed for 'ejb/Invocation'; nested exc
eption is:
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 203 completed: No
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
java:101)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
:130)
... 4 more
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 203 completed: No
at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.writeLock(Unknown Source)
at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendFragment(Unknown Source)
at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendMessage(Unknown Source)
at com.sun.corba.se.impl.encoding.CDROutputObject.finishSendingMessage(Unknown Source)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.finishSendingRequest(Unknown Sour
ce)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(Unkno
wn Source)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknow
n Source)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.is_a(Unknown Source)
at org.omg.CORBA.portable.ObjectImpl._is_a(Unknown Source)
at weblogic.corba.j2ee.naming.Utils.narrowContext(Utils.java:126)
at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
oryImpl.java:94)
at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
oryImpl.java:31)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:41)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initJndiContext(EjbMessageDispat
cher.java:213)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.getJndiContext(EjbMessageDispatc
her.java:226)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
java:87)
... 5 more
can u plz give me some way to do the convertion.Yes Sir.....Thanks for ur suggestion.....
But i didn't find exact solution..well..yes i found some but not exactly there were not in the way i required...I jus need to convert HTML to PDF using iText API for java.....I already used some classes in that like HTMLParser.....etc..
So Any thing else...Any one...Sure can help me in this................ -
Special characters in XML built using the DOM object
I am using the DOM object to build xml but I am having problems with special characters. I have a Element object that I create attributes in. Most special characters like the &, ", or ' are translated for me (amp; quot;, acute; put a & in front of those, if I do it here the browser will translate them into the logical character) but I am having a problem with the � character. The DOM object does not translate this. If I do it my self to(eacute; same here add a & in front) before adding the string to the attribute then the DOM object translates it to (amp;eacute; add a & in front of the amp; not in front of the eacute;). As you can see the DOM object translates the & instead of recognizing that it is a HTML character. Can anyone give me a hand?
I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?
-
Converting html file into zip file and send email attaching zip file
Hi Experts,
I am trying to send email with attachment(html). Which contains more than 7MB. So, It is throwing an error like Size exceeded.
So, Now i need to compress the data for less than 7MB.
I decided to convert HTML File into ZIP File.
Kindly suggest me to convert the HTML file into ZIP file and sending email with attached ZIP file.
Correct answer rewarded,
Thanks & Regards,
N. HARISH KUMARHi Experts,
*// HTML_TAB converting into ZIP File
DATA : zip_tool TYPE REF TO cl_abap_zip,
filename TYPE string ,
filename_zip TYPE string .
DATA : t_data_tab TYPE TABLE OF x255,
bin_size TYPE i,
buffer_x TYPE xstring,
buffer_zip TYPE xstring.
filename = text-007. "'HTML_TAB
*describe the attachment
DESCRIBE TABLE html_tab LINES tab_lines.
bin_size = tab_lines * 255.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = bin_size
IMPORTING
buffer = buffer_x
TABLES
binary_tab = html_tab.
IF sy-subrc <> 0.
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*create zip tool
CREATE OBJECT zip_tool.
*add binary file
CALL METHOD zip_tool->add
EXPORTING
name = 'FSSAI_MAIL.HTML'
content = buffer_x.
*get binary ZIP file
CALL METHOD zip_tool->save
RECEIVING
zip = buffer_zip.
CLEAR: t_data_tab[],bin_size.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = buffer_zip
IMPORTING
output_length = bin_size
TABLES
binary_tab = html_tab.
Thanks & Regards,
N. HARISH KUMAR -
Is anybody programmatically converting HTML to PDF? If so, how?
Is anybody programmatically converting HTML to PDF? If so, how?
With InDesign, or something else?
As long as the application (InDesign or something else) has a command-line interface, i'd like to know about it.
Am using .NET, but we still want to know what you're doing even if you aren't.
Source data is HTML pages from random sources, so it's not necessarily XHTML unfortunately, though i could tidy it into a consistent form.thanks, but what i'm looking for here is programmatic usage -- that is, scripted or command-line -- not having a human user choosing menu options, etc
so as to your two suggestions ...
this would appear to be NOT programmatic ...
> And Acrobat will install a PDF convert toolbar for Internet Explorer to do this right from the browser.
and this might or might not be possible to program -- i don't know if people are somehow running Acrobat programmatically, would appreciate further information
> Acrobat has a Create PDF from Web Page function -
Does any one know if there is a
plug-in for HomeSite to convert HTML documents to XML
documents? This would save alot instead of buying another program
that does this. Because Adobe just finished a online tutorial on
how to use AJAX which made it very easy. Now I need to switch my
HTML docs to XML.
PGIn my previous post I have added a singleton tag img with the closing of it.
Normally the tags which are singleton tags in HTML can beclosed by using /> at the ned of the tag
Like following:
<img src="abcd.gif" />
<input type="button" />
However, I agree with your point about Quotes. In HTML it is not mandatory to put quotes around a value.
But if it is possible then you can make it a habit to put quotes around all the HTML attribute values.
[This is also a standard practice] -
How to write into file from xml dom Object
Hello,
I try to transform my xml DOM document object into
file. I try the following:
try {
// Prepare the DOM document for writing
DOMSource source = new DOMSource(newDoc);
// Prepare the output file
File file = new File(myHomeRep + "btLom.xml");
StreamResult result = new StreamResult(file);
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(source, result);
} catch (TransformerConfigurationException e) {
} catch (TransformerException e) {
But my file is empty.
I do it with some wel formed xml tree document, thus I am certain
that the xml tree exists.
Could you explane me please what I am doeing wrong,
or is there are some possibility to make from my xml dom object
a file.
In advance much thanks,
JuliaHere's one thing you are doing wrong:} catch (TransformerConfigurationException e) {
} catch (TransformerException e) {
}With this code, if an exception occurs then you are guaranteed to know nothing about it. At the minimum do this:} catch (TransformerConfigurationException e) {
e.printStackTrace();
} catch (TransformerException e) {
e.printStackTrace();
} -
Extending Dreamweaver DOM Object
Hi all, I'm looking for a way to extend the Dreamweaver DOM
object with
custom functions.
In this case I need to backport the copyAssets function
http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_pagecontent_cn_088.html
for earlier versions of dreamweaver and reroute calls to an
existing of
custom implementation.
My idea is to create a Startup Item that uses the dom object
as prototype
and extends or overrides certain functions, but then: how
should I tell
dreamweaver to use that object instead of the normal DOM?
Joris van Lier"Joris van Lier" <[email protected]> wrote in message
news:fghlrc$ka$[email protected]..
> Hi all, I'm looking for a way to extend the Dreamweaver
DOM object with
> custom functions.
> In this case I need to backport the copyAssets function
>
http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/dwr_pagecontent_cn_088.html
> for earlier versions of dreamweaver and reroute calls to
an existing of
> custom implementation.
>
> My idea is to create a Startup Item that uses the dom
object as prototype
> and extends or overrides certain functions, but then:
how should I tell
> dreamweaver to use that object instead of the normal
DOM?
>
> --
> Joris van Lier
I'm still looking for the preferred/recommended way of doing
this,
does anyone have a bright idea?
Joris van Lier -
Converted HTML = new appletviewer error
I used the HTMLConverter to make my applet viewable on IE. Now I have problems with Appletviewer! When I type "appletviewer (my applet).html" into the command prompt, appletviewer runs the program twice. This did not happen before conversion.
Here is the converted HTML:
<html>
<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.3 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = "225" HEIGHT = "60" codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<PARAM NAME = CODE VALUE = "Quadratic.class" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="false">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.3" CODE = "Quadratic.class" WIDTH = "300" HEIGHT = "60" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED></COMMENT>
</NOEMBED></EMBED>
</OBJECT>
<!--
<APPLET CODE = "Quadratic.class" WIDTH = "300" HEIGHT = "60">
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
</html>ttt
-
JS/HTML: HTML to DOM so I can XPath
Im new to all this and all I want to do is get info from a
page and redisplay it. I would really like to get that info like
the title suggests tho...I want to start with the html source,
parse it to a DOM and then use xpath to get the info I want. Ive
only ever done this sort of thing in Greasemonkey before tho and
dont seem to able to get it.
Any help would be appreciated.Just to answer my own question ;).......
quote:
<html>
<head>
<title>Get It!</title>
<link href="sample.css" rel="stylesheet"
type="text/css"/>
<script type="text/javascript"
src="lib/air/AIRAliases.js"></script>
<script type="text/javascript"
src="lib/air/AIRIntrospector.js"></script>
<script type="text/javascript">
// AIR-related functions created by the developer
function onHTMLLoadComplete(e)
//get a reference to the top level html document
var doc = html.window.document;
//var doc = e.target.window.document;
var node=doc.evaluate("//title",doc).iterateNext();
// while (thisNode = nodes.interateNext()) {
// alert( thisNode.textContent );
// thisNode = nodes.iterateNext();
var elem = document.createElement( 'div' );
elem.innerText = 'Title of Page is: ' + node.textContent;
document.body.appendChild( elem );
// loads the content of a remote URL
function doRequest(url) {
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4) {
var str = req.responseText;
html = new air.HTMLLoader();
html.addEventListener(air.Event.COMPLETE,
onHTMLLoadComplete);
html.loadString(str);
req.open('GET', url, true);
req.send(null);
function openInBrowser(url) {
air.navigateToURL( new air.URLRequest(url));
</script>
</head>
<body>
<h3>HTML to DOM for XPath</h3>
<ul>
<li>XMLHttpRequest object can reach into remote
domains — the following loads
http://www.adobe.com:
<br/>
<input type="button" onclick='doRequest("
http://www.adobe.com");'
value='doRequest("
http://www.adobe.com");'/>
</li>
</ul>
</body>
</html>
Now Id like to know if there's an option for it to not load
images when it parses the dom. I assume its still loading the
images from the amount of time it took to load (I have dialup). If
not I wonder if a regular expression could be made to wreck the
urls of the images (by changing the href attribute id to something
else) and then search for the new attribute with xpath.....pity Im
no good at regular expressions. -
Hi All,
Any one has clue on how to write large DOM objects on to the HTTP response's Output stream.
When i tried doing that I converted it to string and then transformed wrote to the stream.
The problem is when I have a query that returns me around 8000 or more records the string is not fully formed. We get some malformed xml sent to the browser. So we are not able to view it using the stye sheets on the web browser.Hello Reflex,
Do you mean you have any memory problem ?
It looks like you are fetching data from database and sending it to browser like following:
1) Convert ResultSet to DOM
2) DOM to String
3) String is directed to OutputStream/Writer of ServletResponse.
You can see 1 and 2 are just waste of memory.
Try knocking off any one or both of them. For Example,
1) DOM object can directly written to OutputStream.
2) You can use TransformerHandler to read database and directly write XML to OutputStream in terms of SAX events. -
How to convert html to pdf using acrobat sdk 8.0?
hi
I am a beginner of acrobat sdk .
I want to know How to use acrobat sdk 8.0 to convert html to pdf?
herere some questions :
1:How to support navigation inside PDF file that generated using acrobat sdk 8.0? For example: theres catalog in the top of HTML file, customer hopes can navigate inside the PDF file just like navigating inside the HTML file.
2:How to support operating some controls in the PDF file that generated using acrobat sdk 8.0? For example: therere some drop down list and text box in HTML file, customer hopes can input text in the text box, click the drop down list to see available options in it just like in HTML file.
Thanks in advance for any help and suggestion.Hello,
I want a system to re-brand my 37 pages PDF for affiliates.
I want a php dynamic link in the PDF online in order to personalize automatically the PDF for each affiliate. I need to change 2 links each time. The affiliate ID and the Paypal email (payment button) in page 36.
Can you help?
Please let me know
Thank you
Alex
PS My system is online and i can give you the url if it helps. -
A tool can convert HTML to Excel
Hi All , Are you using report 6i and want to out put report in excel format? If you are , a free software which can convert HTML to Excel is available .
The software is designed to print very large report , Now a wonderful function is added to software , Thru which you can convert HTML to Excel easily . But the function is still basal , It will do better in the future .
For more information, Please visit
http://repbrowser.freewebpage.org/
Thank you ,
RegardsHi,
the only other ways (as I know), if you really want to convert is
a) write a parser to convert html into csv(xls)
b) use a html2csv script on the os level
like:
http://sebsauvage.net/python/html2csv.py (or just google html2csv)
c) use excel (data source web; local file: "file:///C:/test.htm"
Kind Regards,
Dirk -
Error : while converting a WD ABAP object into SAP Transaction
Hi,
I am trying to converting a WD ABAP object into SAP Transaction but i am getting the following error while executing the transaction :
Network Access Message: The page cannot be displayed
Technical Information (for Support personnel)
Error Code: 502 Proxy Error. The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests. (12204)
IP Address: 10.114.6.144
Date: 4/7/2011 10:41:
Please help.> ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests. (12204)
This seems to be your specific network configuration. It seems that your corporate network is blocking HTTPS requests which don't use port 443. Your ABAP system is configured to use a port other than 443. Either talk to your basis admins about changing your ABAP system configuration to use port 443 or talk to your network administrators to allow whichever port the ABAP system is running on.
Maybe you are looking for
-
Can't copy files to NAS via smb
I'm trying to move my Logic files to a NAS in a RAID 1 configuration prior to installation of Logic 9. I'm connecting via Samba. However, I'm continually getting this error message after only a few files are copied: "The operation can't be completed
-
Trying to improve my "g" network?
I am currently running a seemingly good "g" network with Buffalo Airstations (one base and two separate "bridges" connected via ethernet to Directv DVR for on demand and also to Xbox 360). I can use my laptop upstairs and connect to my desktop in the
-
Just got iPhone 6, upgrade from 4s. Setup and restore OK except for music. I want to put ALL of my music on iPhone. In iTunes, settings are to sync entire library. However, it does not. On the phone it shows all songs as on iCloud for downloadin
-
I've seen this problem throughout the website, but nothing hits all my bases. I'm running OS 10.8.4- just upgraded last month. I work for a company that predominantly uses PC's. I'm in the Graphics Department. Neptune is a Windows server but houses a
-
Hello, I have an issue in the versioning of the exp's. and need the help on the same. I saw the post of Daniel Atwood which states as follows: *Processes modeled, implemented, and tested with Designer and Studio, are deployed to the Oracle BPM Enterp