Skip to content Skip to sidebar Skip to footer

Getting Corrupted File When Exporting

So, my other topic was downvoted and I have no idea why. My question is pretty clear and I gave lots of infos. Let's try it again. I'm trying to export all the on the H

Solution 1:

that not valid svg data, it should be like

<svg xmlns="http://www.w3.org/2000/svg" viewBox=..
<path fill="#7AB344" d="M554.457 388.243c....

call exportSVG() in onComplete

$('.svg-convert').svgConvert({
  onComplete: function() {
    exportSVG(document.getElementById('mySVG'));
  }
});

and you need to remove the following line to make it compatible with Inkscape

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<div xmlns="http://www.w3.org/1999/xhtml" id="mySVG">
    <defs xmlns="http://www.w3.org/2000/svg"/>

Solution 2:

Something like the following example is what you should be aiming for.

<svg xmlns="http://www.w3.org/3000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
			
  <svg viewBox="0 0 612 612"><path fill="#7AB344" d="M554.457 388.243c-26.453 31.338-50.593 39.842-90.15 42.498-2.355.159-4.596.388-6.747.669-15.848 2.041-26.179 7.242-32.521 14.737-.201.232-.396.464-.586.703-.18.226-.352.45-.531.684-10.825 14.556-.352 33.054-16.72 39.236 14.962 2.893 28.397 4.335 40.49 4.593 114.973 2.438 106.765-103.12 106.765-103.12z"></path><path fill="#85C55A" d="M464.307 430.741c-2.355.159-4.596.388-6.747.669a57.783 57.783 0 0 0-3.715 4.898 56.238 56.238 0 0 0-6.694 13.487c7.979-3.927 18.332-6.749 31.834-7.329 43.512-1.873 65.338-31.285 75.473-54.224-26.454 31.339-50.594 39.843-90.151 42.499z"></path><path fill="#6EA041" d="M554.457 388.243c-10.135 22.938-31.961 52.351-75.473 54.224-13.502.58-23.854 3.402-31.834 7.329a56.219 56.219 0 0 1 6.694-13.487 57.414 57.414 0 0 1 3.715-4.898c-15.848 2.041-26.179 7.242-32.521 14.737-.201.232-.396.464-.586.703-.18.226-.352.45-.531.684-10.825 14.556-.352 33.054-16.72 39.236 14.962 2.893 28.397 4.335 40.49 4.593 114.974 2.437 106.766-103.121 106.766-103.121zM378.625 510.061c-5.648-5.645-11.294-9.992-23.696-9.251-.521.029-.937.061-1.426.092.788-13.156-.32-27.755-4.378-41.145-19.256-38.339-52.544-41.151-87.544-51.767-2.768 10.264-5.233 2.244-7.275 12.695-3.324 17.027-7.18 34.639-6.388 52.088.388 8.585 2.109 16.316 4.166 24.061 16.73-.904 37.134-6.562 65.68 31.074 4.923 6.485 9.075 11.112 12.801 13.448 1.786 1.119 3.047-.88 4.677-.866 1.384.012 3.138 2.203 4.454 1.355 1.561-1.011 3.092-2.65 4.628-4.969 1.066-1.611 2.078-3.558 3.014-5.788v.003c5.741-13.174 25.457-3.36 40.853 13.622 14.018 15.455-3.915-29.008-9.566-34.652zM173.223 510.385s-1.697 35.757 7.998 45.068c.838.806 3.585-.405 4.603-.035 1.887.678 2.021 2.357 4 1.572 11.435-4.508 23.647-30.392 28.44-43.252 5.627-15.092-19.273-32.207-19.273-32.207l-22.517 8.811-3.251 20.043z"></path><path fill="#A4D175" d="M421.341 555.552c10.893-16.433 17.206-60.533 6.081-97.301-52.758-105.075-178.723-106.174-239.455-91.934-46.885 10.992-78.691 55.685-78.691 55.685-2.814-8.157-3.311-18.241-3.11-26.271-3.204 9.063-5.423 20.046-5.821 33.356-2.148 72.025-49.544 84.115-17.474 103.261 29.095 17.375 105.976 7.129 124.246-19.259 0 0 23.495 33.115 31.919 49.685 2.025 3.978 5.698.581 8.768.349 2.261-.161 3.832-.197 6.198-2.022 10.709-8.263 23-28.568 32.828-53.331 0 0 60.781-18.103 101.004 36.466 5.782 7.836 10.779 13.505 15.305 16.569 2.387 1.622 4.645-1.391 6.817-1.288 2.092.099 4.099 3.364 6.063 1.942 1.796-1.298 3.557-3.255 5.322-5.907z"></path><path fill="#6EA041" d="M109.276 422.002s22.703-23.206 68.895-36.807c64.222-18.902 196.494-32.02 249.251 73.056-3.112-10.316-7.369-20.89-13.029-31.728-56.795-108.722-178.188-105.013-271.473-71.171 0 0-25.059 7.396-36.754 40.379-.201 8.03.296 18.114 3.11 26.271z"></path><path fill="#557635" d="M147.727 487.242c4.986 1.812 11.219-1.978 13.917-8.466 2.683-6.471.82-13.185-4.156-14.973-4.99-1.809-11.209 1.987-13.889 8.459-2.7 6.49-.851 13.188 4.128 14.98z"></path><path fill="#FFF" d="M157.971 473.279c-.951 2.271-3.289 3.555-5.233 2.848-1.951-.708-2.761-3.132-1.813-5.395.944-2.277 3.296-3.548 5.24-2.847 1.94.701 2.75 3.122 1.806 5.394z"></path><path fill="#A4D175" d="M190.312 210.653c-36.141 21.331-54.646 44.466-60.894 68.897-.184.675-.338 1.348-.494 2.012-.141.641-.281 1.277-.412 1.914-7.871 40.371 27.929 68.84 2.352 97.082 0 0 20.189-11.864 19.827-41.855-.363-29.989 9.856-79.934 77.519-117.574 80.629-44.854 96.412-126.35 95.731-183.449-22.881 89.854-61.156 130.217-133.629 172.973zM117.104 423.058s-11.664-23.91-.934-46.634c0 0-15.825 18.086-15.825 52.664 0 34.582 31.349 8.931 31.349 8.931"></path><path fill="#6EA041" d="M90.407 535.853s65.134 9.062 108.854-29.398c26.894-23.66 11.769-51.236 11.769-51.236s32.782 36.194-14.928 72.092c-40.342 30.358-105.695 8.542-105.695 8.542zM373.314 528.203s-26.896-32.206-81.727-31.802c1.292-9.603 1.187-16.193 1.187-16.193-10.458 40.561-26.837 63.791-36.676 74.84-6.261 7.125-8.473 5.957-11.97 7.73-3.521 1.788-6.63-2.913-6.63-2.913 3.634 10.264 9.606 2.516 12.494 4.236.662.472 1.211.879 3.345.879 3.641 0 12.329-6.453 24.097-25.771 5.582-9.159 9.103-19.124 11.364-28.23 13.847-2.865 54.549-8.384 84.516 17.224zM435.402 502.214c0-.271-.025-.527-.025-.798a131.372 131.372 0 0 0-.176-5.972C430.951 380.99 320.622 341.83 320.622 341.83l-36.673 11.338c59.098 4.855 144.128 57.377 144.393 148.628-.19 9.11-1.328 18.413-3.736 27.808-3.596 14.332-8.356 24.477-10.786 28.403-1.663 2.685-2.627-1.526-8.093 1.729-2.342 1.396-6.096-1.729-6.096-1.729s4.123 4.934 6.885 3.251c4.306-2.625 8.212 3.002 11.085-.577 7.741-9.637 17.696-29.486 17.766-58.467h.035z"></path><path fill="#5A7F39" d="M395.285 224.408C341.272 340.244 185.288 358.03 185.288 358.03c247.403 34.786 260.831-179.138 260.831-179.138-17.471 19.783-33.917 34.439-50.834 45.516z"></path><path fill="#85C55A" d="M446.118 178.893c-52.688 57.904-112.272 73.337-153.481 77.828-49.819 5.45-72.807 26.957-81.547 57.098-8.741 30.121-25.802 44.212-25.802 44.212s170.492-4.131 260.83-179.138z"></path><path fill="#5A7F39" d="M323.942 37.68c.681 57.099-31.569 139.771-118.062 175.38-71.599 29.477-60.277 95.709-59.915 125.699.363 29.99-15.1 41.799-15.1 41.799C454.488 295.447 323.942 37.68 323.942 37.68z"></path><path fill="#85C55A" d="M323.942 37.68s33.811 123.095-57.167 235.149c-70.677 87.049-135.909 107.729-135.909 107.729s12.762-14.198 5.099-36.492c-7.663-22.295-29.901-70.938 24.492-116.878C214.85 181.247 287.27 156.926 323.942 37.68z"></path><path fill="#6EA041" d="M349.974 386.888c63.955 33.502 80.787 111.163 60.95 161.07-7.662 19.278-25.238-11.929-41.828-24.016l11.702 12.818s5.859 5.704 9.69 11.858c3.832 6.154 9.618 12.98 14.876 12.98l2.103-1.721 6.986.75 14.353-27.622 2.332-58.763-23.936-61.194-33.687-23.42"></path><path fill="#6EA041" d="M396.458 556.477c-11.723-11.714-26.891-31.482-39.85-31.482-12.96 0 0-3.924 0-3.924s21.478 7.731 39.85 33.104M266.775 372.285c116.051 0 151.974 89.108 151.974 130.545s9.152 6.007 9.152 6.007l-20.699-80.069-37.346-40.524-49.237-22.936-15.213-3.451"></path></svg>
  <svg viewBox="0 0 612 612"><path fill="#8DD4F0" d="M184.487 462.498c.711 4.857 29.934 6.495 39.669-28.649 3.671-13.272 9.657-10.817 15.724-2.582 2.922-5.869 5.069-11.027 6.459-15.583-12.862-3.011-22.855-8.211-29.191-12.261-5.462 10.507-16.124 24.879-36.199 34.756-6.866 3.378-10.347 7.917-11.458 12.095-1.067 12.2 13.709 3.423 14.996 12.224z"></path><path fill="#AED9F1" d="M260.677 474.64c.682.254 3.431-.376 0 0z"></path><path fill="#6786C4" d="M171.105 459.116c2.175 2.501 5.61 1.016 7.817 2.753 2.59 2.026-.845 5.093 2.59 6.989 13.304 7.365 39.17-3.905 50.278-22.788 3.19-5.423 5.861-10.314 8.09-14.804-6.066-8.235-9.367-20.047-13.042-6.775-9.731 35.149-41.639 42.864-42.35 38.007-1.288-8.801-16.063-.024-14.995-12.225-.932 3.498-.213 6.746 1.612 8.843z"></path><path fill="#8DD4F0" d="M217.697 557.058c-.294.393-.591.788-.881 1.188-.121.166-.241.326-.361.496-.212.293-.414.587-.623.88a53.43 53.43 0 0 1-1.083 1.536c-4.404 6.438-7.885 13.046-8.504 18.454-.318 2.791 4.355 2.409 5.83 4.376 1.486 1.981-.226 6.308 3.594 7.086 18.162 3.682 32.98-13.888 42.977-31.41 10.828-20.333-25.866-21.412-40.949-2.606zM260.574 516.377l-39.064-36.956s-22.056 18.586-5.826 39.577c13.078 15.887 37.872 4.055 44.89-2.621z"></path><path fill="#AED9F1" d="M215.833 559.622c.208-.293.41-.587.623-.88-.092.134-.202.265-.29.399-.114.171-.22.312-.333.481zM217.697 557.058c-.308.386-.591.788-.881 1.188.29-.4.587-.796.881-1.188zM214.75 561.158c.35-.475.711-.994 1.083-1.536-.361.51-.729 1.023-1.083 1.536zM216.816 558.246c-.121.166-.241.329-.361.496.12-.17.24-.33.361-.496z"></path><path fill="#6786C4" d="M272.792 527.935l-13.35-17.833c-7.019 6.675-30.681 24.783-43.759 8.896 4.174 5.395 10.835 10.952 21.108 16.393 0 0-10.407 10.057-19.095 21.667 7.945-9.908 21.886-14.288 31.716-13.247 14.062 2.341-2.402 38.346-22.579 46.909 25.593-7.251 39.853-45.311 44.879-59.676.705-1.953 1.08-3.109 1.08-3.109z"></path><path fill="#8DD4F0" d="M337.736 389.352s6.42 31.022 41.469 48.265c9.399 4.623 12.693 10.924 10.782 16.413-1.836 5.275-9.568 4.652-11.546 6.679-3.147 3.233-.251 5.812-5.741 7.106-13.279 3.124-31.341-1.295-44.331-22.307-29.693-48.028-11.685-60.505-11.685-60.505"></path><path fill="#6786C4" d="M356.523 421.337c-15.33-15.587-18.784-31.985-18.784-31.985l-21.051-4.349s-6.046 4.221-5.342 17.122l17.256 17.078c.001 0 11.278 3.107 27.921 2.134z"></path><path fill="#6786C4" d="M340.92 415.684s19.916 26.875 22.24 52.995c0 0-15.367-.867-24.373-9.87-9.197-9.204-11.525-21.044-11.525-21.044l-9.47-15.2M294.558 462.757l4.447 58.165s44.979 27.179 109.396-14.325c-.001 0-69.622 14.956-113.843-43.84z"></path><path fill="#AED9F1" d="M345.727 559.619c-.208-.294-.409-.588-.622-.881.096.138.198.262.29.399.117.171.223.316.332.482zM343.863 557.055c.307.386.59.789.881 1.188-.291-.399-.588-.793-.881-1.188z"></path><path fill="#8DD4F0" d="M343.863 557.055c.293.396.59.789.881 1.188.12.166.244.326.36.496.213.293.414.587.622.881a51.21 51.21 0 0 0 1.083 1.535c2.405 3.513 4.542 7.075 6.078 10.475 3.728 8.256-2.668 6.435-2.905 9.516-.332 4.326 2.321 8.624-4.092 9.922-18.158 3.686-32.98-13.884-42.974-31.405-10.831-20.335 25.867-21.413 40.947-2.608zM300.986 516.373l39.067-36.959s22.054 18.593 5.822 39.581c-13.077 15.887-37.863 4.053-44.889-2.622z"></path><path fill="#AED9F1" d="M346.81 561.154a52.53 52.53 0 0 1-1.083-1.535c.361.513.729 1.022 1.083 1.535z"></path><path fill="#6786C4" d="M300.986 516.373c7.026 6.675 31.812 18.509 44.889 2.622-4.173 5.395-10.834 10.948-21.106 16.392 0 0 10.406 10.058 19.095 21.668-15.08-18.805-51.778-17.727-40.946 2.606-9.049-15.88-14.149-31.727-14.149-31.727l12.217-11.561z"></path><path fill="#AED9F1" d="M344.744 558.242c.12.166.244.33.36.496-.116-.17-.24-.33-.36-.496z"></path><path fill="#6786C4" d="M334.726 590.717c-25.589-7.252-39.849-45.312-44.875-59.673l12.968 4.438s27.549 8.197 10.853 8.197c-16.698.001.197 38.183 21.054 47.038M243.474 385.565l-21.051 4.349s-1.196 5.677-5.274 13.509c6.335 4.05 16.329 9.25 29.191 12.261 7.053-23.22-2.866-30.119-2.866-30.119z"></path><path fill="#8DD4F0" d="M327.63 213.115S312.532 69.456 147.585 15.782c0 0 175.977 128.586 123.46 281.655"></path><g fill="#A09F9F"><path d="M302.826 250.436l19.417 21.097c-8.422-10.803-15.293-21.663-16.665-24.818-1.829 2.316-2.752 3.721-2.752 3.721zM339.686 290.49l-17.443-18.957c5.522 7.075 11.7 14.125 17.443 18.957z"></path></g><path fill="#8DD4F0" d="M278.495 261.596l62.033 4.57c40.03-84.159 95.068-84.931 95.068-84.931-104.483-28.737-157.101 80.361-157.101 80.361z"></path><path fill="#A09F9F" d="M292.439 356.339c-6.986-.353-14.949-.594-24.093-.671a264.528 264.528 0 0 0-3.428 3.519c10.124-.314 20.11-.547 29.64-.66a224.87 224.87 0 0 0-2.119-2.188z"></path><path fill="#6786C4" d="M264.918 359.187c-9.852 10.302-22.71 25.34-33.029 42.814 15.505 4.276 49.906 11.511 101.995 10.364-11.072-22.247-27.515-41.579-39.326-53.839"></path><path fill="#8DD4F0" d="M385.517 269.916c-37.6-64.735-72.978-25.759-72.978-25.759l12.54-29.828c-13.888-5.784-29-9.148-45.021-9.148-26.548 0-48.75 7.856-68.803 22.102-61.173 43.447-86.682 135.296-27.822 155.987 18.101 6.363 48.169 12.787 96.625 12.787 13.435 0 25.937-.332 37.804-1.263 106.495-8.365 96.081-75.938 67.655-124.878z"></path><circle fill="#5273B8" cx="337.734" cy="334.722" r="10.183"></circle><path fill="#FFF" d="M342.854 332.522a4.074 4.074 0 0 1-4.075 4.078 4.076 4.076 0 1 1 4.075-4.078z"></path><circle fill="#5273B8" cx="222.405" cy="334.722" r="10.181"></circle><path fill="#6786C4" d="M246.583 360.221s11.37 14.839 31.579 3.477c0 0 13.892 10.1 30.941-3.477 0 0-3 22.101-30.351 11.801.001-.001-21.114 6.83-32.169-11.801z"></path><path fill="#FFF" d="M228.037 332.522a4.08 4.08 0 0 1-8.158 0 4.08 4.08 0 0 1 8.158 0z"></path><path fill="#8DD4F0" d="M307.711 412.231c-37.568-1.218-63.083-6.721-75.822-10.23a165.655 165.655 0 0 0-3.852 6.841c-8.073 15.229-13.817 31.943-13.817 48.775 0 42.109 18.309 62.255 40.839 69.928 49.21 13.46 70.385-44.2 52.652-115.314z"></path><g><path fill="#6786C4" d="M345.891 457.617c0-12.548-3.191-25.046-8.154-36.903a142.728 142.728 0 0 0-3.853-8.349c-9.299.209-18.068-.134-26.173-.134 6.986 28.013 7.905 53.911 3.487 74.223-13.375 43.687-60.303 41.54-78.641 27.008 18.925 19.92 45.958 21.724 67.25 15.633 8.575-2.162 16.708-5.947 23.694-11.829.06-.051.116-.104.177-.156a49.989 49.989 0 0 0 1.573-1.369l.114-.1.003-.014c12.255-11.345 20.523-29.718 20.523-58.01z"></path></g><path fill="#F1DDEC" d="M357.779 354.036c.248 1.667-3.784 3.634-9.003 4.404-5.225.771-9.649.042-9.897-1.623-.248-1.663 3.785-3.63 9.007-4.4 5.22-.769 9.65-.051 9.893 1.619zM221.715 356.46c-.18 1.677-4.577 2.567-9.823 1.995-5.246-.57-9.346-2.389-9.166-4.061.184-1.677 4.578-2.562 9.827-1.992 5.246.571 9.343 2.384 9.162 4.058z"></path><path fill="#6786C4" d="M355.353 460.963s16.173 6.841 17.999.435c2.61-9.157 15.448-1.4 17.118-9.622 0 0 .703 6.227-7.648 7.766-8.345 1.539-1.691 8.037-13.287 9.176-11.589 1.14-19.428-2.957-19.428-2.957l1.729-2.606"></path><path fill="#5273B8" d="M326.311 243.689s9.94-3.382 20.266-1.401c18.02-62.029 89.02-61.053 89.02-61.053s-77.404-13.813-109.286 62.454z"></path><g><path fill="#6786C4" d="M300.296 243.689c10.06-162.23-152.711-227.907-152.711-227.907s108.193 131.508 32.994 163.246c0 .001 86.426-17.078 119.717 64.661z"></path><path fill="#5273B8" d="M227.287 217.541c.552-.258 1.352-.559 1.899-.803.05-.021.1-.032.148-.053 39.106-12.459 60.756 11.702 68.078 22.332.962 1.5 1.921 3.056 2.883 4.673-32.983-83.643-119.717-64.661-119.717-64.661s32.658 11.065 46.709 38.512z"></path></g><g><path fill="#5273B8" d="M383.373 195.305l-.665-1.019c-15.073 8.225-29.262 21.628-36.132 43.454 10.387-.541 21.837 3.456 26.651 21.388 0 0-3.304-15.335 3.838-32.987-14.861 3.912-23.832-10.797 6.308-30.836z"></path><path fill="#6786C4" d="M435.596 181.236s-27.677-.714-52.888 13.05c-30.143 20.04-21.299 37.26-5.643 31.855 6.668-16.467 22.421-34.951 58.531-44.905z"></path></g><path fill="#6786C4" d="M389.723 269.531c-18.264-27.189-35.313-42.191-63.412-25.841 0 0 32.555-13.93 55.559 28.94 1.504 2.798 2.982 5.861 4.433 9.197.103.241.206.453.311.69 23.62 55.1 5.343 82.143-21.485 94.443-.025.007-.046.021-.046.021-.117.061-.227.103-.319.146-17.645 8.567-43.425 13.778-79.503 13.778-62.259 0-92.561-5.607-107.106-10.817-8.618-3.085-11.426-6.513-11.426-6.513 23.672 23.672 89.989 24.872 113.014 24.975h.028c2.109.014 3.874.011 5.172.011 1.932 0 4.46-.054 7.443-.17 53.678-1.27 94.828-10.935 108.981-33.443 16.344-23.734 9.903-62.179-11.644-95.417z"></path></svg>			

</svg>

You will probably want to tweak it a bit more to improve the result, for example:

  1. Add a viewBox to the root <svg> element.
  2. Optionally set a width and height for the root <svg> element.
  3. Position and size the nested <svg> elements using the x, y, width, and height attributes.

Post a Comment for "Getting Corrupted File When Exporting "